Grouping palette bypass bins for video coding

ABSTRACT

An example method of coding video data includes coding, from a coded video bitstream, a syntax element that indicates whether a transpose process is applied to palette indices of a palette for a current block of video data; decoding, from the coded video bitstream and at a position in the coded video bitstream that is after the syntax element that indicates whether the transpose process is applied to palette indices of the palette for the current block of video data, one or more syntax elements related to delta quantization parameter (QP) and/or chroma QP offsets for the current block of video data; and decoding the current block of video data based on the palette for the current block of video data and the one or more syntax elements related to delta QP and/or chroma QP offsets for the current block of video data.

This application claims the benefit of U.S. Provisional Application No.62/175,137 filed Jun. 12, 2015, the entire content of which isincorporated herein by reference.

TECHNICAL FIELD

This disclosure relates to video encoding and decoding.

BACKGROUND

Digital video capabilities can be incorporated into a wide range ofdevices, including digital televisions, digital direct broadcastsystems, wireless broadcast systems, personal digital assistants (PDAs),laptop or desktop computers, tablet computers, e-book readers, digitalcameras, digital recording devices, digital media players, video gamingdevices, video game consoles, cellular or satellite radio telephones,so-called “smart phones,” video teleconferencing devices, videostreaming devices, and the like. Digital video devices implement videocompression techniques, such as those described in the standards definedby MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264/MPEG-4, Part 10, AdvancedVideo Coding (AVC), ITU-T-H.265, the High Efficiency Video Coding (HEVC)standard, and extensions of such standards. The video devices maytransmit, receive, encode, decode, and/or store digital videoinformation more efficiently by implementing such video compressiontechniques.

Video compression techniques perform spatial (intra-picture) predictionand/or temporal (inter-picture) prediction to reduce or removeredundancy inherent in video sequences. For block-based video coding, avideo slice (i.e., a video frame or a portion of a video frame) may bepartitioned into video blocks. Video blocks in an intra-coded (I) sliceof a picture are encoded using spatial prediction with respect toreference samples in neighboring blocks in the same picture. Videoblocks in an inter-coded (P or B) slice of a picture may use spatialprediction with respect to reference samples in neighboring blocks inthe same picture or temporal prediction with respect to referencesamples in other reference pictures. Pictures may be referred to asframes, and reference pictures may be referred to a reference frames.

Spatial or temporal prediction results in a predictive block for a blockto be coded. Residual data represents pixel differences between theoriginal block to be coded and the predictive block. An inter-codedblock is encoded according to a motion vector that points to a block ofreference samples forming the predictive block, and the residual dataindicates the difference between the coded block and the predictiveblock. An intra-coded block is encoded according to an intra-coding modeand the residual data. For further compression, the residual data may betransformed from the pixel domain to a transform domain, resulting inresidual coefficients, which then may be quantized. The quantizedcoefficients, initially arranged in a two-dimensional array, may bescanned in order to produce a one-dimensional vector of coefficients,and entropy coding may be applied to achieve even more compression.

SUMMARY

In one example, a method of decoding video data includes decoding, froma coded video bitstream, a syntax element that indicates whether atranspose process is applied to palette indices of a palette for acurrent block of video data; decoding, from the coded video bitstreamand at a position in the coded video bitstream that is after the syntaxelement that indicates whether the transpose process is applied topalette indices of the palette for the current block of video data, oneor more syntax elements related to delta quantization parameter (QP)and/or chroma QP offsets for the current block of video data; anddecoding the current block of video data based on the palette for thecurrent block of video data and the one or more syntax elements relatedto delta QP and/or chroma QP offsets for the current block of videodata.

In another example, a method of encoding video data includes encoding,in a coded video bitstream, a syntax element that indicates whether atranspose process is applied to palette indices of a palette for acurrent block of video data; encoding, in the coded video bitstream andat a position in the coded video bitstream that is after the syntaxelement that indicates whether the transpose process is applied topalette indices of the palette for the current block of video data, oneor more syntax elements related to delta QP and/or chroma QP offsets forthe current block of video data; and encoding the current block of videodata based on the palette for the current block of video data and theone or more syntax elements related to delta QP and/or chroma QP offsetsfor the current block of video data.

In another example, a device for coding video data includes a memoryconfigured to store video data and one or more processors. In thisexample, the one or more processors are configured to: code, in a codedvideo bitstream, a syntax element that indicates whether a transposeprocess is applied to palette indices of a palette for a current blockof video data; code, in the coded video bitstream and at a position inthe coded video bitstream that is after the syntax element thatindicates whether the transpose process is applied to palette indices ofthe palette for the current block of video data, one or more syntaxelements related to delta QP and/or chroma QP offsets for the currentblock of video data; and code the current block of video data based onthe palette for the current block of video data and the one or moresyntax elements related to delta QP and/or chroma QP offsets for thecurrent block of video data

In another example, a device for coding video data includes means forcoding, in a coded video bitstream, a syntax element that indicateswhether a transpose process is applied to palette indices of a palettefor a current block of video data; means for coding, in the coded videobitstream and at a position in the coded video bitstream that is afterthe syntax element that indicates whether the transpose process isapplied to palette indices of the palette for the current block of videodata, one or more syntax elements related to delta QP and/or chroma QPoffsets for the current block of video data; and means for coding thecurrent block of video data based on the palette for the current blockof video data and the one or more syntax elements related to delta QPand/or chroma QP offsets for the current block of video data.

In another example, a computer-readable storage medium storesinstructions that, when executed, cause one or more processors of avideo coding device to: code, in a coded video bitstream, a syntaxelement that indicates whether a transpose process is applied to paletteindices of a palette for a current block of video data; code, in thecoded video bitstream and at a position in the coded video bitstreamthat is after the syntax element that indicates whether the transposeprocess is applied to palette indices of the palette for the currentblock of video data, one or more syntax elements related to delta QPand/or chroma QP offsets for the current block of video data; and codethe current block of video data based on the palette for the currentblock of video data and the one or more syntax elements related to deltaQP and/or chroma QP offsets for the current block of video data.

In another example, a computer-readable storage medium stores at least aportion of a coded video bitstream that, when processed by a videodecoding device, cause one or more processors of the video decodingdevice to: determine whether a transpose process is applied to paletteindices of a palette for a current block of video data; and decode thecurrent block of the video data based on the palette for the currentblock of video data and a delta QP and one or more chroma QP offsets forthe current block of video data, wherein one or more syntax elementsrelated to the delta QP and one or more syntax elements related to theone or more chroma QP offsets for the current block of video data arelocated at a position in the coded video bitstream that is after asyntax element that indicates whether the transpose process is appliedto palette indices of the palette for the current block of video data.

The details of one or more examples are set forth in the accompanyingdrawings and the description below. Other features, objects, andadvantages will be apparent from the description and drawings, and fromthe claims.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram illustrating an example video coding systemthat may utilize the techniques described in this disclosure.

FIG. 2 is a block diagram illustrating an example video encoder that mayimplement the techniques described in this disclosure.

FIG. 3 is a block diagram illustrating an example video decoder that mayimplement the techniques described in this disclosure.

FIG. 4 is a conceptual diagram illustrating an example of determining apalette for coding video data, consistent with techniques of thisdisclosure.

FIG. 5 is a conceptual diagram illustrating an example of determiningindices to a palette for a block of pixels, consistent with techniquesof this disclosure.

FIG. 6 is a flowchart illustrating an example process for decoding ablock of video data using palette mode, in accordance with one or moretechniques of this disclosure.

FIG. 7 is a flowchart illustrating an example process for encoding ablock of video data using palette mode, in accordance with one or moretechniques of this disclosure.

DETAILED DESCRIPTION

This disclosure describes techniques for video coding and compression.In particular, this disclosure describes techniques for palette-basedcoding of video data. For instance, this disclosure describes techniquesto support coding of video content, especially screen content withpalette coding, such as techniques for improved palette indexbinarization, and techniques for signaling for palette coding.

In traditional video coding, images are assumed to be continuous-toneand spatially smooth. Based on these assumptions, various tools havebeen developed such as block-based transform, filtering, etc., and suchtools have shown good performance for natural content videos.

However, in applications like remote desktop, collaborative work andwireless display, computer generated screen content may be the dominantcontent to be compressed. This type of content tends to havediscrete-tone and feature sharp lines, and high contrast objectboundaries. The assumption of continuous-tone and smoothness may nolonger apply and thus traditional video coding techniques may not beefficient ways to compress.

Based on the characteristics of screen content video, palette coding isintroduced to improve screen content coding (SCC) efficiency as proposedin Guo et al., “Palette Mode for Screen Content Coding,” JointCollaborative Team on Video Coding (JCT-VC) of ITU-T SG 16 WP 3 andISO/IEC JTC 1/SC 29/WG 11, 13th Meeting: Incheon, KR, 18-26 Apr. 2013,Document: JCTVC-M0323, available athttp://phenix.it-sudparis.eu/jct/doc_end_user/documents/13_Incheon/wg11/JCTVC-M0323-v3.zip,(hereinafter “JCTVC-M0323”). Specifically, palette coding introduces alookup table, i.e., a color palette, to compress repetitive pixel valuesbased on the fact that in SCC, colors within one CU usually concentrateon a few peak values. Given a palette for a specific CU, pixels withinthe CU are mapped to palette indices. In the second stage, an effectivecopy from left run length method is proposed to effectively compress theindex block's repetitive pattern. In some examples, the palette indexcoding mode may be generalized to both copy from left and copy fromabove with run length coding. Note that, in some examples, notransformation process may be invoked for palette coding to avoidblurring sharp edges which can have a huge negative impact on visualquality of screen contents.

As discussed above, this disclosure describes palette-based coding,which may be particularly suitable for screen generated content coding.For example, assume a particular area of video data has a relativelysmall number of colors. A video coder (a video encoder or video decoder)may code a so-called “palette” as a table of colors for representing thevideo data of the particular area (e.g., a given block). Each pixel maybe associated with an entry in the palette that represents the color ofthe pixel. For example, the video coder may code an index that maps thepixel value to the appropriate value in the palette.

In the example above, a video encoder may encode a block of video databy determining a palette for the block, locating an entry in the paletteto represent the color value of each pixel, and encoding the palettewith index values for the pixels mapping the pixel value to the palette.A video decoder may obtain, from an encoded bitstream, a palette for ablock, as well as index values for the pixels of the block. The videodecoder may map the index values of the pixels to entries of the paletteto reconstruct the luma and chroma pixel values of the block.

The example above is intended to provide a general description ofpalette-based coding. In various examples, the techniques described inthis disclosure may include techniques for various combinations of oneor more of signaling palette-based coding modes, transmitting palettes,predicting palettes, deriving palettes, and transmitting palette-basedcoding maps and other syntax elements. Such techniques may improve videocoding efficiency, e.g., requiring fewer bits to represent screengenerated content.

For example, according to aspects of this disclosure, a video coder(video encoder or video decoder) may code one or more syntax elementsfor each block that is coded using a palette coding mode. For example,the video coder may code a palette_mode_flag to indicate whether apalette-based coding mode is to be used for coding a particular block.In this example, a video encoder may encode a palette_mode_flag with avalue that is equal to one to specify that the block currently beingencoded (“current block”) is encoded using a palette mode. In this case,a video decoder may obtain the palette_mode_flag from the encodedbitstream and apply the palette-based coding mode to decode the block.In instances in which there is more than one palette-based coding modeavailable (e.g., there is more than one palette-based techniqueavailable for coding), one or more syntax elements may indicate one of aplurality of different palette modes for the block.

In some instances, the video encoder may encode a palette_mode_flag witha value that is equal to zero to specify that the current block is notencoded using a palette mode. In such instances, the video encoder mayencode the block using any of a variety of inter-predictive,intra-predictive, or other coding modes. When the palette_mode_flag isequal to zero, the video encoder may encode additional information(e.g., syntax elements) to indicate the specific mode that is used forencoding the respective block. In some examples, as described below, themode may be an HEVC coding mode. The use of the palette_mode_flag isdescribed for purposes of example. In other examples, other syntaxelements such as multi-bit codes may be used to indicate whether thepalette-based coding mode is to be used for one or more blocks, or toindicate which of a plurality of modes are to be used.

When a palette-based coding mode is used, a palette may be transmittedby an encoder in the encoded video data bitstream for use by a decoder.A palette may be transmitted for each block or may be shared among anumber of blocks in a picture or slice. The palette may refer to anumber of pixel values that are dominant and/or representative for theblock, including, e.g., a luma value and two chroma values.

In some examples, a syntax element, such as a transpose flag, may becoded to indicate whether a transpose process is applied to paletteindices of a current palette. If transpose flag is zero, the paletteindices for samples may be coded in a horizontal traverse scan.Similarly, if the transpose flag is one, the palette indices for samplesmay be coded in a vertical traverse scan. This can be thought of asdecoding the index values assuming horizontal traverse scan and thentransposing the block (rows to columns).

Aspects of this disclosure include techniques for coding the palette.For example, according to aspects of this disclosure, a video encodermay encode one or more syntax elements to define a palette. Some examplesyntax elements which a video encoder may encode to define a currentpalette for a current block of video data include, but are not limitedto, a syntax element that indicates whether a transpose process isapplied to palette indices of the current palette (e.g.,palette_transpose_flag) (i.e., whether the, one or more syntax elementsrelated to delta quantization parameter (QP) (e.g.,cu_qp_delta_palette_abs, cu_qp_delta_palette_sign_flag,cu_chroma_qp_palette_offset_flag, and/orcu_chroma_qp_palette_offset_idx), one or more syntax elements related tochroma QP offsets for the current block of video data, one or moresyntax elements that indicate a number of zeros that precede a non-zeroentry in an array that indicates whether entries from a predictorpalette are reused in the current palette (e.g., palette_predictor_run),one or more syntax elements that indicate a number of entries in thecurrent palette that are explicitly signalled (e.g.,num_signalled_palette_entries), one or more syntax elements thatindicate a value of a component in a palette entry in the currentpalette (e.g., palette_entry), one or more syntax elements that indicatewhether the current block of video data includes at least one escapecoded sample (e.g., palette_escape_val_present_flag), one or more syntaxelements that indicate a number of entries in the current palette thatare explicitly signalled or inferred (e.g., num_palette_indices_idc),and one or more syntax elements that indicate indices in an array ofcurrent palette entries (e.g., palette_index_idc). For example, whenoperating in accordance with the HEVC Screen Content Coding (SCC) Draft3 (Joshi et al., “High Efficiency Video Coding (HEVC) Screen ContentCoding: Draft 3,” Joint Collaborative Team on Video Coding (JCT-VC) ofITU-T SG 16 WP 3 and ISO/IEC JTC 1/SC 29/WG 11, 20th Meeting: Geneva,CH, 10 Feb.-17 Feb. 2015, Document: JCTVC-T1005, available athttp://phenix.int-evey.fr/jct/doc_end_user/documents/20_Geneva/wg11/JCTVC-T1005-v2.zip,(hereinafter “HEVC SCC Draft 3”), a video coder may signal the syntaxelements listed in palette_coding( ) syntax table (section 7.3.8.8 ofHEVC SCC Draft 3), reproduced below as Table 1.

TABLE 1 Descriptor palette_coding( x0, y0, nCbS ) { palettePredictionFinished = 0  NumPredictedPaletteEntries = 0  for( i =0; i < PredictorPaletteSize && !palettePredictionFinished &&  NumPredictedPaletteEntries < palette_max_size; i++ ) {  palette_predictor_run ue(v)   if( palette_predictor_run != 1 ) {   if( palette_predictor_run > 1 )     i += palette_predictor_run − 1   PalettePredictorEntryReuseFlag[ i ] = 1   NumPredictedPaletteEntries++   } else    palettePredictionFinished =1  }  if( NumPredictedPaletteEntries < palette_max_size )  num_signalled_palette_entries ue(v)  numComps = (ChromaArrayType = = 0) ? 1 : 3  for( cIdx = 0; cIdx < numComps; cIdx++ )   for( i = 0; i <num_signalled_palette_entries; i++ )    palette_entry ae(v)  if(CurrentPaletteSize != 0 )   palette_escape_val_present_flag ae(v)    if( palette_escape_val_present_flag ) {      if(cu_qp_delta_enabled_flag && !IsCuQpDeltaCoded ) {      cu_qp_delta_palette_abs ae(v)       if( cu_qp_delta_palette_abs )       cu_qp_delta_palette_sign_flag ae(v)      }      if(cu_chroma_qp_offset_enabled_flag && !IsCuChromaQpOffsetCoded ) {      cu_chroma_qp_palette_offset_flag ae(v)       if(cu_chroma_qp_offset_flag && chroma_qp_offset_list_len_minus1 > 0 )       cu_chroma_qp_palette_offset_idx ae(v)      }     }  if(MaxPaletteIndex > 0) {   palette_transpose_flag ae(v)  num_palette_indices_idc ae(v)   for( i=0; i < NumPaletteIndices; i++ ){    palette_index_idc ae(v)    PaletteIndexIdc[ i ] = palette_index_idc  }   last_palette_run_type_flag ae(v)  }  CurrNumIndices = 0 PaletteScanPos = 0  while( PaletteScanPos < nCbS * nCbS) {   xC = x0 +travScan[ PaletteScanPos ][ 0 ]   yC = y0 + travScan[ PaletteScanPos ][1 ]   if( PaletteScanPos > 0) {    xcPrev = x0 + travScan[PaletteScanPos − 1 ][ 0 ]    ycPrev = y0 + travScan[ PaletteScanPos − 1][ 1 ]   }   PaletteRun = nCbS * nCbS − PaletteScanPos − 1   if(MaxPaletteIndex > 0 && CurrNumIndices < NumPaletteIndices ) {    if(PaletteScanPos >= nCbS && palette_run_type_flag[ xcPrev ][ ycPrev ]    != COPY_ABOVE_MODE && PaletteScanPos < nCbS * nCbS − 1) {    palette_run_type_flag[ xC ][ yC ] ae(v)    }    readIndex = 0    if(palette_run_type_flag[ xC ][ yC ] = = COPY_INDEX_MODE &&    AdjustedMaxPaletteIndex > 0)     readIndex = 1    maxPaletteRun =nCbS* nCbS − PaletteScanPos − 1    if( AdjustedMaxPaletteIndex > 0 &&    ( ( CurrNumIndices + readIndex ) < NumPaletteIndices | |    palette_run_type_flag[ xC ][ yC ] != last_palette_run_type_flag ) )    if( maxPaletteRun > 0) {      palette_run_msb_id_plus1 ae(v)     if( palette_run_msb_id_plus1 > 1 )      palette_run_refinement_bits ae(v)     }    CurrNumIndices + =readIndex   }   runPos = 0   while ( runPos < = paletteRun ) {    xR =x0 + travScan[ PaletteScanPos ][ 0 ]    yR = y0 + travScan[PaletteScanPos ][ 1 ]    if(palette_run_type_flag[ xC ][ yC ] = =COPY_INDEX_MODE ) {     PaletteSampleMode[ xR ][ yR ] = COPY_INDEX_MODE    PaletteIndexMap[ xR ][ yR ] = CurrPaletteIndex    } else {    PaletteSampleMode[ xR ][ yR ] = COPY_ABOVE_MODE     PaletteIndexMap[xR ][ yR ] = PaletteIndexMap[ xR ][ yR − 1 ]    }    runPos++   PaletteScanPos++   }  }  if( palette_escape_val_present_flag ) {  sPos = 0   while( sPos < nCbS * nCbS ) {    xC = x0 + travScan[ sPos][ 0 ]    yC = y0 + travScan[ sPos ][ 1 ]    if( PaletteIndexMap[ xC ][yC ] = = MaxPaletteIndex ) {     for( cIdx = 0; cIdx < numComps; cIdx++)      if( cIdx = = 0 | |       ( xR % 2 = = 0 && yR % 2 = = 0 &&ChromaArrayType = = 1 ) | |       ( xR % 2 = = 0 && ChromaArrayType = =2 ) | |       ChromaArrayType = = 3 ) {        palette_escape_val ae(v)       PaletteEscapeVal[ cIdx ][ xC ][ yC ] = palette_escape_val      }   }    sPos++   }  } }

In addition to providing an order in which the syntax elements areincluded in a bitstream, Table 1 also provides a descriptor for each ofthe syntax elements that indicates an encoding type for each syntaxelement. As one example, a video encoder may encode syntax elements withthe ue(v) descriptor using unsigned integer 0-th order Exp-Golomb-codeswith the left bit first. As another example, a video encoder may encodesyntax elements with the ae(v) descriptor using context-adaptivearithmetic entropy-codes (CABAC). When bins of a syntax element areencoded use CABAC, a video encoder may encode one or more of the binsusing a context and/or may encode one or more of the bins without acontext. Encoding a bin using CABAC without a context may be referred toas bypass mode. HEVC SCC Draft 3 further provides a table (Table 9-47 ofthe HEVC SCC Draft 3), partially reproduced below as Table 2, thatindicates which bins of the syntax elements listed in Table 1 are codedwith contexts (i.e., as indicated by context “0” and context “1”) andwhich bins are coded in bypass mode.

TABLE 2 binIdx Syntax element 0 1 2 3 4 >= 5 palette_predictor_runbypass bypass bypass bypass bypass bypass num_signalled_palette_entriesbypass bypass bypass bypass bypass bypass palette_entry bypass bypassbypass bypass bypass bypass palette_escape_val_present_flag bypass na nana na na cu_qp_delta_palette_abs 0 1 1 1 1 bypasscu_qp_delta_palette_sign_flag bypass na na na na nacu_chroma_qp_palette_offset_flag 0 na na na na nacu_chroma_qp_palette_offset_idx 0 0 0 0 0 na palette_transpose_flag 0 nana na na na num_palette_indices_idc bypass bypass bypass bypass bypassbypass last_palette_run_type_flag 0 na na na na na palette_run_type_flag0 na Na na na na palette_index_idc bypass bypass bypass bypass bypassbypass palette_run_msb_id_plus1 (clause 9.3.4.2.8)palette_run_refinement_bits bypass bypass bypass bypass bypass bypasspalette_escape_val bypass bypass bypass bypass bypass bypass

A comparison of Table1 and Table 2 shows that HEVC SCC Draft 3prescribes that all the syntax elements before cu_qp_delta_palette_abs(i.e., num_signalled_palette_entries, palette_entry, andpalette_escape_val_present_flag) are bypass-coded. Similarly, syntaxelements after palette_transpose_flag and beforelast_palette_run_type_flag (i.e., num_palette_indices_idc andpalette_index_idc) are also bypass coded.

When encoding a bin using CABAC with a context, a video encoder may loadthe context from storage into memory. In some examples, a video encodermay have limited memory resources available and/or it may be timeconsuming to load a context into memory. As such, it may be desirablefor a video encoder to minimize the amount of times contexts are loadedinto memory. In some examples, grouping bypass bins together may reducethe amount of times contexts are loaded into memory, which may increaseCABAC throughput.

In Ye et al., “CE1-related: Palette Mode Context and CodewordSimplification,” Joint Collaborative Team on Video Coding (JCT-VC) ofITU-T SG 16 WP 3 and ISO/IEC JTC 1/SC 29/WG 11, 21st Meeting: Warsaw, PL, 19-26 Jun. 2015, Document: JCTVC-U0090, available athttp://phenix.it-sudparis.eu/jct/doc_end_user/documents/21_Warsaw/wg11/JCTVC-U0090-v1.zip(hereinafter, “JCTVC-U0090”), it was proposed that thepalette_transpose_flag be signalled after thelast_palette_run_type_flag. Specifically, JCTVC-U0090 proposes modifyingthe palette coding( ) syntax table as shown below in Table 3 (where textin italics is inserted and text in [[double bracket italics]] isdeleted).

TABLE 3 if( MaxPaletteIndex > 0) {  [[palette_transpose_flag]] [[ae(v)]] num_palette_indices_idc ae(v)  for( i=0; i < NumPaletteIndices; i++ ) {  palette_index_idc ae(v)   PaletteIndexIdc[ i ] = palette_index_idc  } last_palette_run_type_flag ae(v)  palette_transpose_flag ae(v) }

However, in some examples, the arrangement of syntax elements proposedby JCTVC-U0090 may not be optimal. For instance, when syntax elementsrelated to delta QP (i.e., cu_qp_delta_palette_abs andcu_qp_delta_palette_sign_flag) and chroma QP offset (i.e.,cu_chroma_qp_palette_offset_flag and cu_chroma_qp_palette_offset_idx)are present, the arrangement of syntax elements proposed by JCTVC-U0090may not result in grouping of any additional bypass bins.

In accordance with one or more techniques of this disclosure, a videoencoder may encode the syntax elements used to define a current palettesuch that syntax elements that are encoded using bypass mode areconsecutively encoded. For instance, as opposed to encoding one or moresyntax elements related to delta quantization parameter (QP) and/orchroma QP offsets for a current block of video data before a syntaxelement that indicates whether a transpose process is applied to paletteindices of a palette for the current block of video data, a videoencoder may encode the one or more syntax elements related to delta QPand/or chroma QP offsets for the current block of video data after thesyntax element that indicates whether a transpose process is applied tothe palette indices of the palette for the current block of video data.

One example of how the palette coding( ) syntax table may be modified tomove the signalling of the syntax elements related to delta QP andchroma QP offsets after the palette_transpose_flag is shown below inTable 4 (where text in italics is inserted and text in [[double bracketitalics]] is deleted relative to a previous version of Table 4 in HEVCSCC Draft 3).

TABLE 4 Descriptor palette_coding( x0, y0, nCbS ) { palettePredictionFinished = 0  NumPredictedPaletteEntries = 0  for( i =0; i < PredictorPaletteSize && !palettePredictionFinished &&   NumPredictedPaletteEntries < palette_max_size; i++ ) {   palette_predictor_run ue(v)    if( palette_predictor_run != 1 ) {    if( palette_predictor_run > 1 )      i += palette_predictor_run − 1    PalettePredictorEntryReuseFlag[ i ] = 1    NumPredictedPaletteEntries++    } else     palettePredictionFinished= 1  }  if( NumPredictedPaletteEntries < palette_max_size )   num_signalled_palette_entries ue(v)  numComps = ( ChromaArrayType = =0 ) ? 1 : 3  for( cIdx = 0; cIdx < numComps; cIdx++ )    for( i = 0; i <num_signalled_palette_entries; i++ )     palette_entry ae(v)  if(CurrentPaletteSize != 0 )    palette_escape_val_present_flag ae(v) [[if( palette_escape_val_present_flag ) {]]   [[if(cu_qp_delta_enabled_flag && !IsCuQpDeltaCoded ) {]]   [[cu_qp_delta_palette_abs]] [[ae(v)]]    [[if(cu_qp_delta_palette_abs )]]     [[cu_qp_delta_palette_sign_flag]][[ae(v)]]   [[}]]   [[if( cu_chroma_qp_offset_enabled_flag &&!IsCuChromaQpOffsetCoded ) {]]    [[cu_chroma_qp_palette_offset_flag]][[ae(v)]]    [[if( cu_chroma_qp_offset_flag &&chroma_qp_offset_list_len_minus1 > 0 )]]    [[cu_chroma_qp_palette_offset_idx]] [[ae(v)]]   [[}]]  [[}]]  if(MaxPaletteIndex > 0) {    [[palette_transpose_flag]] [[ae(v)]]   num_palette_indices_idc ae(v)    for( i=0; i < NumPaletteIndices; i++) {     palette_index_idc ae(v)     PaletteIndexIdc[ i ] =palette_index_idc    }    last_palette_run_type_flag ae(v)   palette_transpose_flag ae(v)  }  if( palette_escape_val_present_flag) {   if( cu_qp_delta_enabled_flag && !IsCuQpDeltaCoded ) {   cu_qp_delta_palette_abs ae(v)    if( cu_qp_delta_palette_abs )    cu_qp_delta_palette_sign_flag ae(v)   }   if(cu_chroma_qp_offset_enabled_flag && !IsCuChromaQpOffsetCoded ) {   cu_chroma_qp_palette_offset_flag ae(v)    if(cu_chroma_qp_offset_flag && chroma_qp_offset_list_len_minus1 > 0 )    cu_chroma_qp_palette_offset_idx ae(v)   }  }  CurrNumIndices = 0 PaletteScanPos = 0 ...

By moving the one or more syntax elements related to delta QP and/orchroma QP offsets for the current block of video data after the syntaxelement that indicates whether a transpose process is applied to thepalette indices of the palette for the current block of video data, thevideo encoder may group together (i.e., consecutively encode) a largernumber of syntax elements that are coded using bypass mode. For example,by moving the one or more syntax elements related to delta QP and/orchroma QP offsets for the current block of video data after the syntaxelement that indicates whether a transpose process is applied to thepalette indices of the palette for the current block of video data, thevideo encoder may group together one or more syntax elements thatindicate a number of entries in the current palette that are explicitlysignalled or inferred (e.g., num_palette_indices_idc) and one or moresyntax elements that entriesindices in an array of current paletteentries (e.g., palette_index_idc) with one or more syntax elementsrelated to chroma QP offsets for the current block of video data, one ormore syntax elements that indicate a number of zeros that precede anon-zero entry in an array that indicates whether entries from apredictor palette are reused in the current palette (e.g.,palette_predictor_run), one or more syntax elements that indicate anumber of entries in the current palette that are explicitly signalled(e.g., num_signalled_palette_entries), one or more syntax elements thatindicate a value of a component in a palette entry in the currentpalette (e.g., palette_entry), and one or more syntax elements thatindicate whether the current block of video data includes at least oneescape coded sample (e.g., palette_escape_val_present_flag). In thisway, the techniques of this disclosure may increase CABAC throughput,which may reduce the time needed to encode video data using palette modeencoding. For instance, by grouping together the bypass coded syntaxelements, a video coder may sequentially encode the grouped syntaxelements using without starting, stopping, restarting, reloading, andresetting a CABAC coding engine

Table 4 is only one example of how the syntax elements may be arranged.In some examples, the syntax elements related to delta QP and chroma QPoffset may be moved further down the syntax table. For example, thesyntax elements related to delta QP and chroma QP offset could be placedjust before the component values for escape samples (i.e.,palette_escape_val). One example of how the syntax elements related todelta QP and chroma QP offset could be placed just before the componentvalues for escape samples is shown below in Table 5 (where text initalics is inserted and text in [[double bracket italics]] is deletedrelative to HEVC SCC Draft 3).

TABLE 5 Descriptor palette_coding( x0, y0, nCbS ) { palettePredictionFinished = 0  NumPredictedPaletteEntries = 0  for( i =0; i < PredictorPaletteSize && !palettePredictionFinished &&   NumPredictedPaletteEntries < palette_max_size; i++ ) {   palette_predictor_run ue(v)    if( palette_predictor_run != 1 ) {    if( palette_predictor_run > 1 )      i += palette_predictor_run − 1    PalettePredictorEntryReuseFlag[ i ] = 1    NumPredictedPaletteEntries++    } else     palettePredictionFinished= 1  }  if( NumPredictedPaletteEntries < palette_max_size )   num_signalled_palette_entries ue(v)  numComps = ( ChromaArrayType = =0 ) ? 1 : 3  for( cIdx = 0; cIdx < numComps; cIdx++ )    for( i = 0; i <num_signalled_palette_entries; i++ )     palette_entry ae(v)  if(CurrentPaletteSize != 0 )    palette_escape_val_present_flag ae(v) [[if( palette_escape_val_present_flag ) {]]   [[if(cu_qp_delta_enabled_flag && !IsCuQpDeltaCoded ) {]]   [[cu_qp_delta_palette_abs]] [[ae(v)]]    [[if(cu_qp_delta_palette_abs )]]     [[cu_qp_delta_palette_sign_flag]][[ae(v)]]   [[}]]   [[if( cu_chroma_qp_offset_enabled_flag &&!IsCuChromaQpOffsetCoded ) {]]    [[cu_chroma_qp_palette_offset_flag]][[ae(v)]]    [[if( cu_chroma_qp_offset_flag &&chroma_qp_offset_list_len_minus1 > 0 )]]    [[cu_chroma_qp_palette_offset_idx]] [[ae(v)]]   [[}]]  [[}]]  if(MaxPaletteIndex > 0) {

   num_palette_indices_idc ae(v)    for( i=0; i < NumPaletteIndices; i++) {     palette_index_idc ae(v)     PaletteIndexIdc[ i ] =palette_index_idc    }    last_palette_run_type_flag ae(v)   palette_transpose_flag ae(v)  }  CurrNumIndices = 0  PaletteScanPos =0  while( PaletteScanPos < nCbS * nCbS ) {    xC = x0 + travScan[PaletteScanPos ][ 0 ]    yC = y0 + travScan[ PaletteScanPos ][ 1 ]   if( PaletteScanPos > 0) {     xcPrev = x0 + travScan[ PaletteScanPos− 1 ][ 0 ]     ycPrev = y0 + travScan[ PaletteScanPos − 1 ][ 1 ]    }   PaletteRun = nCbS * nCbS − PaletteScanPos − 1    if(MaxPaletteIndex > 0 && CurrNumIndices < NumPaletteIndices ) {     if(PaletteScanPos >= nCbS && palette_run_type_flag[ xcPrev ][ ycPrev ]     != COPY_ABOVE_MODE && PaletteScanPos < nCbS * nCbS − 1) {     palette_run_type_flag[ xC ][ yC ] ae(v)     }     readIndex = 0    if( palette_run_type_flag[ xC ][ yC ] = = COPY_INDEX_MODE &&     AdjustedMaxPaletteIndex > 0)      readIndex = 1     maxPaletteRun =nCbS * nCbS − PaletteScanPos − 1     if( AdjustedMaxPaletteIndex > 0 &&     ( ( CurrNumIndices + readIndex ) < NumPaletteIndices | |     palette_run_type_flag[ xC ][ yC ] != last_palette_run_type_flag ) )     if( maxPaletteRun > 0) {       palette_run_msb_id_plus1 ae(v)      if( palette_run_msb_id_plus1 > 1 )       palette_run_refinement_bits ae(v)      }     CurrNumIndices + =readIndex    }    runPos = 0    while ( runPos < = paletteRun ) {     xR= x0 + travScan[ PaletteScanPos ][ 0 ]     yR = y0 + travScan[PaletteScanPos ][ 1 ]     if(palette_run_type_flag[ xC ][ yC ] = =COPY_INDEX_MODE ) {      PaletteSampleMode[ xR ][ yR ] = COPY_INDEX_MODE     PaletteIndexMap[ xR ][ yR ] = CurrPaletteIndex     } else {     PaletteSampleMode[ xR ][ yR ] = COPY_ABOVE_MODE     PaletteIndexMap[ xR ][ yR ] = PaletteIndexMap[ xR ][ yR − 1 ]     }    runPos++     PaletteScanPos++    }  }  if(palette_escape_val_present_flag ) {   if( cu_qp_delta_enabled_flag &&!IsCuQpDeltaCoded ) {    cu_qp_delta_palette_abs ae(v)    if(cu_qp_delta_palette_abs )     cu_qp_delta_palette_sign_flag ae(v)   }  if( cu_chroma_qp_offset_enabled_flag && !IsCuChromaQpOffsetCoded ) {   cu_chroma_qp_palette_offset_flag ae(v)    if(cu_chroma_qp_offset_flag && chroma_qp_offset_list_len_minus1 > 0 )    cu_chroma_qp_palette_offset_idx ae(v)   }    sPos = 0    while( sPos< nCbS * nCbS ) {     xC = x0 + travScan[ sPos ][ 0 ]     yC = y0 +travScan[ sPos ][ 1 ]     if( PaletteIndexMap[ xC ][ yC ] = =MaxPaletteIndex ) {      for( cIdx = 0; cIdx < numComps; cIdx++ )      if( cIdx = = 0 | |        ( xR % 2 = = 0 && yR % 2 = = 0 &&ChromaArrayType = = 1 ) | |        ( xR % 2 = = 0 && ChromaArrayType = =2 ) | |        ChromaArrayType = = 3 ) {         palette_escape_valae(v)         PaletteEscapeVal[ cIdx ][ xC ][ yC ] = palette_escape_val      }     }     sPos++    }  } }

The techniques for palette-based coding of video data may be used withone or more other coding techniques, such as techniques for inter- orintra-predictive coding. For example, as described in greater detailbelow, an encoder or decoder, or combined encoder-decoder (codec), maybe configured to perform inter- and intra-predictive coding, as well aspalette-based coding.

In some examples, the palette-based coding techniques may be configuredfor use with one or more video coding standards. Some example videocoding standards include, but are not limited to, ITU-T H.261, ISO/IECMPEG-1 Visual, ITU-T H.262 or ISO/IEC MPEG-2 Visual, ITU-T H.263,ISO/IEC MPEG-4 Visual and ITU-T H.264 (also known as ISO/IEC MPEG-4AVC), including its Scalable Video Coding (SVC) and Multiview VideoCoding (MVC) extensions.

Recently, the design of a new video coding standard, namelyHigh-Efficiency Video Coding (HEVC), has been finalized by the JointCollaboration Team on Video Coding (JCT-VC) of ITU-T Video CodingExperts Group (VCEG) and ISO/IEC Motion Picture Experts Group (MPEG). Acopy of the finalized HEVC standard (i.e., ITU-T H.265, Series H:AUDIOVISUAL AND MULTIMEDIA SYSTEMS Infrastructure of audiovisualservices—Coding of moving video, April, 2015) is available athttps://www.itu.int/rec/T-REC-H.265-201504-I/en, (hereinafter the “HEVCStandard”.

A Range Extension to HEVC, namely HEVC Screen Content Coding (SCC), isalso being developed by the JCT-VC. A recent draft of HEVC SCC (Joshi etal., “High Efficiency Video Coding (HEVC) Screen Content Coding: Draft4,” Joint Collaborative Team on Video Coding (JCT-VC) of ITU-T SG 16 WP3 and ISO/IEC JTC 1/SC 29/WG 11, 21st Meeting: Warsaw, P L, 19 Jun.-16Jun. 2015, is available fromhttp://phenix.it-sudparis.eu/jct/doc_end_user/documents/21_Warsaw/wg11/JCTVC-U1005-v2.zip,(hereinafter “HEVC SCC Draft 4”).

With respect to the HEVC framework, as an example, the palette-basedcoding techniques may be configured to be used as a coding unit (CU)mode. In other examples, the palette-based coding techniques may beconfigured to be used as a prediction unit (PU) mode in the framework ofHEVC. Accordingly, all of the following disclosed processes described inthe context of a CU mode may, additionally or alternatively, apply toPU. However, these HEVC-based examples should not be considered arestriction or limitation of the palette-based coding techniquesdescribed herein, as such techniques may be applied to workindependently or as part of other existing or yet to be developedsystems/standards. In these cases, the unit for palette coding can besquare blocks, rectangular blocks, or even regions of non-rectangularshape.

FIG. 1 is a block diagram illustrating an example video coding system 10that may utilize the techniques of this disclosure. As used herein, theterm “video coder” refers generically to both video encoders and videodecoders. In this disclosure, the terms “video coding” or “coding” mayrefer generically to video encoding or video decoding. Video encoder 20and video decoder 30 of video coding system 10 represent examples ofdevices that may be configured to perform techniques for palette-basedvideo coding in accordance with various examples described in thisdisclosure. For example, video encoder 20 and video decoder 30 may beconfigured to selectively code various blocks of video data, such asCU's or PU's in HEVC coding, using either palette-based coding ornon-palette based coding. Non-palette based coding modes may refer tovarious inter-predictive temporal coding modes or intra-predictivespatial coding modes, such as the various coding modes specified by theHEVC Standard.

As shown in FIG. 1, video coding system 10 includes a source device 12and a destination device 14. Source device 12 generates encoded videodata. Accordingly, source device 12 may be referred to as a videoencoding device or a video encoding apparatus. Destination device 14 maydecode the encoded video data generated by source device 12.Accordingly, destination device 14 may be referred to as a videodecoding device or a video decoding apparatus. Source device 12 anddestination device 14 may be examples of video coding devices or videocoding apparatuses.

Source device 12 and destination device 14 may comprise a wide range ofdevices, including desktop computers, mobile computing devices, notebook(e.g., laptop) computers, tablet computers, set-top boxes, telephonehandsets such as so-called “smart” phones, televisions, cameras, displaydevices, digital media players, video gaming consoles, in-car computers,or the like.

Destination device 14 may receive encoded video data from source device12 via a channel 16. Channel 16 may comprise one or more media ordevices capable of moving the encoded video data from source device 12to destination device 14. In one example, channel 16 may comprise one ormore communication media that enable source device 12 to transmitencoded video data directly to destination device 14 in real-time. Inthis example, source device 12 may modulate the encoded video dataaccording to a communication standard, such as a wireless communicationprotocol, and may transmit the modulated video data to destinationdevice 14. The one or more communication media may include wirelessand/or wired communication media, such as a radio frequency (RF)spectrum or one or more physical transmission lines. The one or morecommunication media may form part of a packet-based network, such as alocal area network, a wide-area network, or a global network (e.g., theInternet). The one or more communication media may include routers,switches, base stations, or other equipment that facilitatecommunication from source device 12 to destination device 14.

In another example, channel 16 may include a storage medium that storesencoded video data generated by source device 12. In this example,destination device 14 may access the storage medium via disk access orcard access. The storage medium may include a variety oflocally-accessed data storage media such as Blu-ray discs, DVDs,CD-ROMs, flash memory, or other suitable digital storage media forstoring encoded video data.

In a further example, channel 16 may include a file server or anotherintermediate storage device that stores encoded video data generated bysource device 12. In this example, destination device 14 may accessencoded video data stored at the file server or other intermediatestorage device via streaming or download. The file server may be a typeof server capable of storing encoded video data and transmitting theencoded video data to destination device 14. Example file serversinclude web servers (e.g., for a website), file transfer protocol (FTP)servers, network attached storage (NAS) devices, and local disk drives.

Destination device 14 may access the encoded video data through astandard data connection, such as an Internet connection. Example typesof data connections may include wireless channels (e.g., Wi-Ficonnections), wired connections (e.g., DSL, cable modem, etc.), orcombinations of both that are suitable for accessing encoded video datastored on a file server. The transmission of encoded video data from thefile server may be a streaming transmission, a download transmission, ora combination of both.

The techniques of this disclosure are not limited to wirelessapplications or settings. The techniques may be applied to video codingin support of a variety of multimedia applications, such as over-the-airtelevision broadcasts, cable television transmissions, satellitetelevision transmissions, streaming video transmissions, e.g., via theInternet, encoding of video data for storage on a data storage medium,decoding of video data stored on a data storage medium, or otherapplications. In some examples, video coding system 10 may be configuredto support one-way or two-way video transmission to support applicationssuch as video streaming, video playback, video broadcasting, and/orvideo telephony.

FIG. 1 is merely an example and the techniques of this disclosure mayapply to video coding settings (e.g., video encoding or video decoding)that do not necessarily include any data communication between theencoding and decoding devices. In other examples, data is retrieved froma local memory, streamed over a network, or the like. A video encodingdevice may encode and store data to memory, and/or a video decodingdevice may retrieve and decode data from memory. In many examples, theencoding and decoding is performed by devices that do not communicatewith one another, but simply encode data to memory and/or retrieve anddecode data from memory. Source device 12 and destination device 14 maycomprise any of a wide range of devices, including desktop computers,notebook (i.e., laptop) computers, tablet computers, set-top boxes,appliances, telephone handsets such as so-called “smart” phones,so-called “smart” pads, televisions, cameras, display devices, digitalmedia players, video gaming consoles, video streaming device, or thelike. In some cases, source device 12 and destination device 14 may beequipped for wireless communication.

Destination device 14 may receive the encoded video data to be decodedvia a link 16. Link 16 may comprise any type of medium or device capableof moving the encoded video data from source device 12 to destinationdevice 14. In one example, link 16 may comprise a communication mediumto enable source device 12 to transmit encoded video data directly todestination device 14 in real-time. The encoded video data may bemodulated according to a communication standard, such as a wirelesscommunication protocol, and transmitted to destination device 14. Thecommunication medium may comprise any wireless or wired communicationmedium, such as a radio frequency (RF) spectrum or one or more physicaltransmission lines. The communication medium may form part of apacket-based network, such as a local area network, a wide-area network,or a global network such as the Internet. The communication medium mayinclude routers, switches, base stations, or any other equipment thatmay be useful to facilitate communication from source device 12 todestination device 14.

Alternatively, encoded data may be output from output interface 22 to astorage device 19. Similarly, encoded data may be accessed from storagedevice 19 by input interface. Storage device 19 may include any of avariety of distributed or locally accessed data storage media such as ahard drive, Blu-ray discs, DVDs, CD-ROMs, flash memory, volatile ornon-volatile memory, or any other suitable digital storage media forstoring encoded video data. In a further example, storage device 19 maycorrespond to a file server or another intermediate storage device thatmay hold the encoded video generated by source device 12. Destinationdevice 14 may access stored video data from storage device 19 viastreaming or download. The file server may be any type of server capableof storing encoded video data and transmitting that encoded video datato the destination device 14. Example file servers include a web server(e.g., for a website), an FTP server, network attached storage (NAS)devices, or a local disk drive. Destination device 14 may access theencoded video data through any standard data connection, including anInternet connection. This may include a wireless channel (e.g., a Wi-Ficonnection), a wired connection (e.g., DSL, cable modem, etc.), or acombination of both that is suitable for accessing encoded video datastored on a file server. The transmission of encoded video data fromstorage device 19 may be a streaming transmission, a downloadtransmission, or a combination of both.

The techniques of this disclosure are not necessarily limited towireless applications or settings. The techniques may be applied tovideo coding in support of any of a variety of multimedia applications,such as over-the-air television broadcasts, cable televisiontransmissions, satellite television transmissions, streaming videotransmissions, e.g., via the Internet, encoding of digital video forstorage on a data storage medium, decoding of digital video stored on adata storage medium, or other applications. In some examples, system 10may be configured to support one-way or two-way video transmission tosupport applications such as video streaming, video playback, videobroadcasting, and/or video telephony.

In the example of FIG. 1, source device 12 includes a video source 18,video encoder 20 and an output interface 22. In some cases, outputinterface 22 may include a modulator/demodulator (modem) and/or atransmitter. In source device 12, video source 18 may include a sourcesuch as a video capture device, e.g., a video camera, a video archivecontaining previously captured video, a video feed interface to receivevideo from a video content provider, and/or a computer graphics systemfor generating computer graphics data as the source video, or acombination of such sources. As one example, if video source 18 is avideo camera, source device 12 and destination device 14 may formso-called camera phones or video phones. However, the techniquesdescribed in this disclosure may be applicable to video coding ingeneral, and may be applied to wireless and/or wired applications.

The captured, pre-captured, or computer-generated video may be encodedby video encoder 20. The encoded video data may be transmitted directlyto destination device 14 via output interface 22 of source device 12.The encoded video data may also (or alternatively) be stored ontostorage device 19 for later access by destination device 14 or otherdevices, for decoding and/or playback.

Destination device 14 includes an input interface 28, a video decoder30, and a display device 32. In some cases, input interface 28 mayinclude a receiver and/or a modem. Input interface 28 of destinationdevice 14 receives the encoded video data over link 16. The encodedvideo data communicated over link 16, or provided on storage device 19,may include a variety of syntax elements generated by video encoder 20for use by a video decoder, such as video decoder 30, in decoding thevideo data. Such syntax elements may be included with the encoded videodata transmitted on a communication medium, stored on a storage medium,or stored a file server.

Display device 32 may be integrated with, or external to, destinationdevice 14. In some examples, destination device 14 may include anintegrated display device and also be configured to interface with anexternal display device. In other examples, destination device 14 may bea display device. In general, display device 32 displays the decodedvideo data to a user, and may comprise any of a variety of displaydevices such as a liquid crystal display (LCD), a plasma display, anorganic light emitting diode (OLED) display, or another type of displaydevice.

Video encoder 20 and video decoder 30 may operate according to a videocompression standard, such as the recently finalized HEVC standard (andvarious extensions thereof presently under development). Alternatively,video encoder 20 and video decoder 30 may operate according to otherproprietary or industry standards, such as the ITU-T H.264 standard,alternatively referred to as MPEG-4, Part 10, Advanced Video Coding(AVC), or extensions of such standards. The techniques of thisdisclosure, however, are not limited to any particular coding standard.Other examples of video compression standards include VP8, and VP9.

Although not shown in FIG. 1, in some aspects, video encoder 20 andvideo decoder 30 may each be integrated with an audio encoder anddecoder, and may include appropriate MUX-DEMUX units, or other hardwareand software, to handle encoding of both audio and video in a commondata stream or separate data streams. If applicable, in some examples,MUX-DEMUX units may conform to the ITU H.223 multiplexer protocol, orother protocols such as the user datagram protocol (UDP).

Video encoder 20 and video decoder 30 each may be implemented as any ofa variety of suitable encoder circuitry, such as one or more integratedcircuits including microprocessors, digital signal processors (DSPs),application specific integrated circuits (ASICs), field programmablegate arrays (FPGAs), discrete logic, software, hardware, firmware, orany combinations thereof. When the techniques are implemented partiallyin software, a device may store instructions for the software in asuitable, non-transitory computer-readable medium and execute theinstructions in hardware such as integrated circuitry using one or moreprocessors to perform the techniques of this disclosure. Each of videoencoder 20 and video decoder 30 may be included in one or more encodersor decoders, either of which may be integrated as part of a combinedencoder/decoder (CODEC) in a respective device.

As introduced above, the JCT-VC has recently finalized development ofthe HEVC standard. The HEVC standardization efforts were based on anevolving model of a video coding device referred to as the HEVC TestModel (HM). The HM presumes several additional capabilities of videocoding devices relative to existing devices according to, e.g., ITU-TH.264/AVC. For example, whereas H.264 provides nine intra-predictionencoding modes, the HM may provide as many as thirty-fiveintra-prediction encoding modes.

In HEVC and other video coding specifications, a video sequencetypically includes a series of pictures. Pictures may also be referredto as “frames.” A picture may include three sample arrays, denotedS_(L), S_(Cb), and S_(Cr). S_(L) is a two-dimensional array (i.e., ablock) of luma samples. S_(Cb) is a two-dimensional array of Cbchrominance samples. S_(Cr) is a two-dimensional array of Cr chrominancesamples. Chrominance samples may also be referred to herein as “chroma”samples. In other instances, a picture may be monochrome and may onlyinclude an array of luma samples.

To generate an encoded representation of a picture, video encoder 20 maygenerate a set of coding tree units (CTUs). Each of the CTUs maycomprise a coding tree block of luma samples, two corresponding codingtree blocks of chroma samples, and syntax structures used to code thesamples of the coding tree blocks. In monochrome pictures or pictureshaving three separate color planes, a CTU may comprise a single codingtree block and syntax structures used to code the samples of the codingtree block. A coding tree block may be an N×N block of samples. A CTUmay also be referred to as a “tree block” or a LCU. The CTUs of HEVC maybe broadly analogous to the macroblocks of other standards, such asH.264/AVC. However, a CTU is not necessarily limited to a particularsize and may include one or more coding units (CUs). A slice may includean integer number of CTUs ordered consecutively in a raster scan order.

To generate a coded CTU, video encoder 20 may recursively performquad-tree partitioning on the coding tree blocks of a CTU to divide thecoding tree blocks into coding blocks, hence the name “coding treeunits.” A coding block may be an N×N block of samples. A CU may comprisea coding block of luma samples and two corresponding coding blocks ofchroma samples of a picture that has a luma sample array, a Cb samplearray, and a Cr sample array, and syntax structures used to code thesamples of the coding blocks. In monochrome pictures or pictures havingthree separate color planes, a CU may comprise a single coding block andsyntax structures used to code the samples of the coding block.

Video encoder 20 may partition a coding block of a CU into one or moreprediction blocks. A prediction block is a rectangular (i.e., square ornon-square) block of samples on which the same prediction is applied. Aprediction unit (PU) of a CU may comprise a prediction block of lumasamples, two corresponding prediction blocks of chroma samples, andsyntax structures used to predict the prediction blocks. In monochromepictures or pictures having three separate color planes, a PU maycomprise a single prediction block and syntax structures used to predictthe prediction block. Video encoder 20 may generate predictive luma, Cb,and Cr blocks for luma, Cb, and Cr prediction blocks of each PU of theCU.

Video encoder 20 may use intra prediction or inter prediction togenerate the predictive blocks for a PU. If video encoder 20 uses intraprediction to generate the predictive blocks of a PU, video encoder 20may generate the predictive blocks of the PU based on decoded samples ofthe picture associated with the PU. If video encoder 20 uses interprediction to generate the predictive blocks of a PU, video encoder 20may generate the predictive blocks of the PU based on decoded samples ofone or more pictures other than the picture associated with the PU.

After video encoder 20 generates predictive luma, Cb, and Cr blocks forone or more PUs of a CU, video encoder 20 may generate a luma residualblock for the CU. Each sample in the CU's luma residual block indicatesa difference between a luma sample in one of the CU's predictive lumablocks and a corresponding sample in the CU's original luma codingblock. In addition, video encoder 20 may generate a Cb residual blockfor the CU. Each sample in the CU's Cb residual block may indicate adifference between a Cb sample in one of the CU's predictive Cb blocksand a corresponding sample in the CU's original Cb coding block. Videoencoder 20 may also generate a Cr residual block for the CU. Each samplein the CU's Cr residual block may indicate a difference between a Crsample in one of the CU's predictive Cr blocks and a correspondingsample in the CU's original Cr coding block.

Furthermore, video encoder 20 may use quad-tree partitioning todecompose the luma, Cb, and Cr residual blocks of a CU into one or moreluma, Cb, and Cr transform blocks. A transform block is a rectangular(e.g., square or non-square) block of samples on which the sametransform is applied. A transform unit (TU) of a CU may comprise atransform block of luma samples, two corresponding transform blocks ofchroma samples, and syntax structures used to transform the transformblock samples. Thus, each TU of a CU may be associated with a lumatransform block, a Cb transform block, and a Cr transform block. Theluma transform block associated with the TU may be a sub-block of theCU's luma residual block. The Cb transform block may be a sub-block ofthe CU's Cb residual block. The Cr transform block may be a sub-block ofthe CU's Cr residual block. In monochrome pictures or pictures havingthree separate color planes, a TU may comprise a single transform blockand syntax structures used to transform the samples of the transformblock.

Video encoder 20 may apply one or more transforms to a luma transformblock of a TU to generate a luma coefficient block for the TU. Acoefficient block may be a two-dimensional array of transformcoefficients. A transform coefficient may be a scalar quantity. Videoencoder 20 may apply one or more transforms to a Cb transform block of aTU to generate a Cb coefficient block for the TU. Video encoder 20 mayapply one or more transforms to a Cr transform block of a TU to generatea Cr coefficient block for the TU.

After generating a coefficient block (e.g., a luma coefficient block, aCb coefficient block or a Cr coefficient block), video encoder 20 mayquantize the coefficient block. Quantization generally refers to aprocess in which transform coefficients are quantized to possibly reducethe amount of data used to represent the transform coefficients,providing further compression. After video encoder 20 quantizes acoefficient block, video encoder 20 may entropy encode syntax elementsindicating the quantized transform coefficients. For example, videoencoder 20 may perform Context-Adaptive Binary Arithmetic Coding (CABAC)on the syntax elements indicating the quantized transform coefficients.

Video encoder 20 may output a bitstream that includes a sequence of bitsthat forms a representation of coded pictures and associated data. Thebitstream may comprise a sequence of NAL units. A NAL unit is a syntaxstructure containing an indication of the type of data in the NAL unitand bytes containing that data in the form of a RBSP interspersed asnecessary with emulation prevention bits. Each of the NAL units includesa NAL unit header and encapsulates a RBSP. The NAL unit header mayinclude a syntax element that indicates a NAL unit type code. The NALunit type code specified by the NAL unit header of a NAL unit indicatesthe type of the NAL unit. A RBSP may be a syntax structure containing aninteger number of bytes that is encapsulated within a NAL unit. In someinstances, an RBSP includes zero bits.

Different types of NAL units may encapsulate different types of RBSPs.For example, a first type of NAL unit may encapsulate an RBSP for a PPS,a second type of NAL unit may encapsulate an RBSP for a coded slice, athird type of NAL unit may encapsulate an RBSP for SEI messages, and soon. NAL units that encapsulate RBSPs for video coding data (as opposedto RBSPs for parameter sets and SEI messages) may be referred to as VCLNAL units.

Video decoder 30 may receive a bitstream generated by video encoder 20.In addition, video decoder 30 may parse the bitstream to obtain syntaxelements from the bitstream. Video decoder 30 may reconstruct thepictures of the video data based at least in part on the syntax elementsobtained from the bitstream. The process to reconstruct the video datamay be generally reciprocal to the process performed by video encoder20. In addition, video decoder 30 may inverse quantize coefficientblocks associated with TUs of a current CU. Video decoder 30 may performinverse transforms on the coefficient blocks to reconstruct transformblocks associated with the TUs of the current CU. Video decoder 30 mayreconstruct the coding blocks of the current CU by adding the samples ofthe predictive blocks for PUs of the current CU to corresponding samplesof the transform blocks of the TUs of the current CU. By reconstructingthe coding blocks for each CU of a picture, video decoder 30 mayreconstruct the picture.

In some examples, video encoder 20 and video decoder 30 may beconfigured to perform palette-based coding. For example, in palettebased coding, rather than performing the intra-predictive orinter-predictive coding techniques described above, video encoder 20 andvideo decoder 30 may code a so-called palette as a table of color valuesfor representing the video data of the particular area (e.g., a givenblock). Each pixel may be associated with an entry in the palette thatrepresents the color of the pixel, e.g., with a luma (Y) value andchroma (Cb and Cr) values. For example, video encoder 20 and videodecoder 30 may code an index that relates the pixel value to theappropriate value in the palette.

In the example above, video encoder 20 may encode a block of video databy determining a palette for the block, locating an entry in the paletteto represent the value of each pixel, and encoding the palette withindex values for the pixels relating the pixel value to the palette.Video decoder 30 may obtain, from an encoded bitstream, a palette for ablock, as well as index values for the pixels of the block. Videodecoder 30 may relate the index values of the pixels to entries of thepalette to reconstruct the pixel values of the block.

Aspects of this disclosure are directed to palette derivation, which mayoccur at the encoder and at the decoder. As one example, video encoder20 may derive a palette for a current block by deriving a histogram ofthe pixels in the current block. In some examples, the histogram may beexpressed as H={(v_(i),f_(i)), i={0, 1, 2, . . . , M}} where M+1 is thenumber of different pixel values in the current block, v_(i) is pixelvalue, and f_(i) is the number of occurrence of v_(i) (i.e., how manypixels in the current block have pixel value v_(i)). In such examples,the histogram generally represents a number of times that a pixel valueoccurs in the current block.

Video encoder 20 may initialize one or more variables when deriving thehistogram. As one example, video encoder 20 may initialize a paletteindex idx to 0, (i.e., set idx=0). As another example, video encoder 20may initialize the palette P to be empty (i.e., P=, set j=0.).

Video encoder 20 may sort the histogram, e.g., in descending order, suchthat pixels having more occurrences are placed near the front of a listof values. For instance, video encoder 20 may sort H according to thedescending order of f_(i) and the ordered list may be expressed asH_(o)={(u_(i), f_(i)), i={0, 1, 2, . . . , M}, f_(i)≧f_(i+1)}. In thisexample, the ordered list includes the most frequently occurring pixelvalues at the front (top) of the list and the least frequently occurringpixel values at the back (bottom) of the list.

Video encoder 20 may copy one or more entries from the histogram intothe palette. As one example, video encoder 20 may insert the entry inthe histogram with the greatest frequency into the palette. Forinstance, video encoder 20 may insert (j, u_(j)) into the palette P(i.e., P=P∪{(idx,u_(j))}). In some examples, after inserting the entryinto the palette, video encoder 20 may evaluate the entry in thehistogram with the next greatest frequency for insertion into thepalette. For instance, video encoder 20 may set idx idx+1, j=j+1.

Video encoder 20 may determine whether the entry with the next greatestfrequency (i.e., u_(j+1)) is within the neighborhood of any pixel (i.e.,x) in the palette (i.e., Distance(u_(j+1),x)<Thresh). For instance,video encoder 20 may determine whether the entry is within theneighborhood of any pixel in the palette by determining whether a valueof the entry is within a threshold distance of a value of any pixel inthe palette. In some examples, video encoder 20 may flexibly select thedistance function. As one example, video encoder 20 may select thedistance function as a sum of absolute differences (SAD) or a sum ofsquared errors of prediction (SSE) of the three color components (e.g.,each of luminance, blue hue chrominance, and red hue chrominance), orone color component (e.g., one of luminance, blue hue chrominance, orred hue chrominance). In some examples, video encoder 20 may flexiblyselect the threshold value Thresh. As one example, video encoder 20 mayselect the threshold value to be dependent on the quantization parameter(QP) of the current block. As another example, video encoder 20 mayselect the threshold value to be dependent on the value of idx or thevalue of j.

If video encoder 20 determines that the entry with the next greatestfrequency (i.e., u_(j+1)) is within the neighborhood of any pixel in thepalette, video encoder 20 may not insert the entry in the histogram. Ifvideo encoder 20 determines that the entry with the next greatestfrequency (i.e., u_(j+1)) is not within the neighborhood of any pixel inthe palette, video encoder 20 may insert the entry in the histogram.

Video encoder 20 may continue to insert entries in the palette until oneor more conditions are satisfied. Some example conditions are whenidx=M, when j=M, or when the size of the palette is larger than apredefined value.

Palette-based coding may have a certain amount of signaling overhead.For example, a number of bits may be needed to signal characteristics ofa palette, such as a size of the palette, as well as the palette itself.In addition, a number of bits may be needed to signal index values forthe pixels of the block. The techniques of this disclosure may, in someexamples, reduce the number of bits needed to signal such information.For example, the techniques described in this disclosure may includetechniques for various combinations of one or more of signalingpalette-based coding modes, transmitting palettes, predicting palettes,deriving palettes, and transmitting palette-based coding maps and othersyntax elements.

In some examples, video encoder 20 and/or video decoder 30 may predict apalette using another palette. For example, video encoder 20 and/orvideo decoder 30 may determine a first palette having first entriesindicating first pixel values. Video encoder 20 and/or video decoder 30may then determine, based on the first entries of the first palette, oneor more second entries indicating second pixel values of a secondpalette. Video encoder 20 and/or video decoder 30 may also code pixelsof a block of video data using the second palette.

When determining the entries of the second palette based on the entriesin the first palette, video encoder 20 may encode a variety of syntaxelements, which may be used by video decoder to reconstruct the secondpalette. For example, video encoder 20 may encode one or more syntaxelements in a bitstream to indicate that an entire palette (or palettes,in the case of each color component, e.g., Y, Cb, Cr, or Y, U, V, or R,G, B, of the video data having a separate palette) is copied from one ormore neighboring blocks of the block currently being coded. The palettefrom which entries of the current palette of the current block arepredicted (e.g., copied) may be referred to as a predictive palette. Thepredictive palette may contain palette entries from one or moreneighboring blocks including spatially neighboring blocks and/orneighboring blocks in a particular scan order of the blocks. Forexample, the neighboring blocks may be spatially located to the left(left neighboring block) of or above (upper neighboring block) the blockcurrently being coded. In another example, video encoder 20 maydetermine predictive palette entries using the most frequent samplevalues in a causal neighbor of the current block. In another example,the neighboring blocks may neighbor the block current being codedaccording to a particular scan order used to code the blocks. That is,the neighboring blocks may be one or more blocks coded prior to thecurrent block in the scan order. Video encoder 20 may encode one or moresyntax elements to indicate the location of the neighboring blocks fromwhich the palette(s) are copied.

In some examples, palette prediction may be performed entry-wise. Forexample, video encoder 20 may encode one or more syntax elements toindicate, for each entry of a predictive palette, whether the paletteentry is included in the palette for the current block. If video encoder20 does not predict an entry of the palette for the current block, videoencoder 20 may encode one or more additional syntax elements to specifythe non-predicted entries, as well as the number of such entries.

The syntax elements described above may be referred to as a paletteprediction vector. For example, as noted above, video encoder 20 andvideo decoder 30 may predict a palette for a current block based on oneor more palettes from neighboring blocks (referred to collectively as areference palette). When generating the reference palette, a first-infirst-out (FIFO) may be used by adding the latest palette into the frontof the queue. If the queue exceeds a predefined threshold, the oldestelements may be popped out. After pushing new elements into the front ofthe queue, a pruning process may be applied to remove duplicatedelements, counting from the beginning of the queue. Specifically, insome examples, video encoder 20 may encode (and video decoder 30 maydecode) a 0-1 vector to indicate whether the pixel values in thereference palette are reused for the current palette. As an example, asshown in the example of Table 6, a reference palette may include sixitems (e.g., six index values and respective pixel values).

TABLE 6 Index Pixel Value 0 v₀ 1 v₁ 2 v₂ 3 v₃ 4 v₄ 5 v₅In an example for purposes of illustration, video encoder 20 may signala vector (1, 0, 1, 1, 1, 1) that indicates that v₀, v₂, v₃, v₄, and v₅are reused in the current palette, while v₁ is not re-used. In additionto reusing v₀, v₂, v₃, v₄, and v₅, video encoder 20 may add two newitems to the current palette with indexes 5 and 6. The current palettefor this example is shown in Table 7, below.

TABLE 7 Pred Flag Index Pixel Value 1 0 v₀ 0 1 1 v₂ 1 2 v₃ 1 3 v₄ 1 4 v₅5 u₀ 6 u₁

To code the palette prediction 0-1 vector, for each item in the vector,video encoder 20 may code one bit to represent its value. Additionally,the number of palette items which cannot be predicted (e.g., the numberof new palette entries (u0 and u1 in the example of Table 7 above)) maybe binarized and signaled.

Other aspects of this disclosure relate to constructing and/ortransmitting a map that allows video encoder 20 and/or video decoder 30to determine pixel values. For example, other aspects of this disclosurerelate to constructing and/or transmitting a map of indices that relatea particular pixel to an entry of a palette.

In some examples, video encoder 20 may indicate whether pixels of ablock have a corresponding value in a palette. In an example forpurposes of illustration, assume that an (i, j) entry of a mapcorresponds to an (i, j) pixel position in a block of video data. Inthis example, video encoder 20 may encode a flag for each pixel positionof a block. Video encoder 20 may set the flag equal to one for the (i,j) entry to indicate that the pixel value at the (i, j) location is oneof the values in the palette. When a color is included in the palette(i.e., the flag is equal to one), video encoder 20 may also encode dataindicating a palette index for the (i, j) entry that identifies thecolor in the palette. When the color of the pixel is not included in thepalette (i.e., the flag is equal to zero) video encoder 20 may alsoencode data indicating a sample value for the pixel, which may bereferred to as an escape pixel. Video decoder 30 may obtain theabove-described data from an encoded bitstream and use the data todetermine a palette index and/or pixel value for a particular locationin a block.

In some instances, there may be a correlation between the palette indexto which a pixel at a given position is mapped and the probability of aneighboring pixel being mapped to the same palette index. That is, whena pixel is mapped to a particular palette index, the probability may berelatively high that one or more neighboring pixels (in terms of spatiallocation) are mapped to the same palette index.

In some examples, video encoder 20 and/or video decoder 30 may determineand code one or more indices of a block of video data relative to one ormore indices of the same block of video data. For example, video encoder20 and/or video decoder 30 may be configured to determine a first indexvalue associated with a first pixel in a block of video data, where thefirst index value relates a value of the first pixel to an entry of apalette. Video encoder 20 and/or video decoder 30 may also be configuredto determine, based on the first index value, one or more second indexvalues associated with one or more second pixels in the block of videodata, and to code the first and the one or more second pixels of theblock of video data. Thus, in this example, indices of a map may becoded relative to one or more other indices of the map.

As discussed above, video encoder 20 and/or video decoder 30 may useseveral different techniques to code index values of a map relative toother indices of the map. For instance, video encoder 20 and/or videodecoder 30 may use index mode, copy above mode, and transition mode tocode index values of a map relative to other indices of the map.

In the “index mode” of pallet-based coding, video encoder 20 and/orvideo decoder 30 may first signal a palette index. If the index is equalto the size of the palette, this indicates that the sample is an escapesample. In this case, video encoder 20 and/or video decoder 30 maysignal the sample value or quantized samples value for each component.For example, if the palette size is 4, for non-escape samples, thepalette indices are in the range [0, 3]. In this case, an index value of4 may signify an escape sample. If the index indicates a non-escapesample, video encoder 20 and/or video decoder 30 may signal arun-length, which may specify the number of subsequent samples inscanning order that share the same index, by a non-negative value n−1indicating the run length, which means that the following n pixelsincluding the current one have the same pixel index as the firstsignaled index.

In the “copy from above” mode of palette-based coding, video encoder 20and/or video decoder 30 may signal a non-negative run length value m−1to indicate that for the following m pixels including the current pixel,palette indexes are the same as their neighbors directly above,respectively. Note that the copy from above” mode is different from the“index” mode, in the sense that the palette indices could be differentwithin the “copy from above” run mode.

As discussed above, in some examples, it may be desirable to groupbypass bins together (i.e., to increase CABAC throughput). In accordancewith one or more techniques of this disclosure, video encoder 20 mayencode, and video decoder 30 may decode, syntax elements used to definea current palette such that syntax elements that are coded using bypassmode are grouped together. For instance, as opposed to coding one ormore syntax elements related to delta quantization parameter (QP) and/orchroma QP offsets for a current block of video data before a syntaxelement that indicates whether a transpose process is applied to paletteindices of a palette for the current block of video data, video encoder20 and/or video decoder 30 may code the one or more syntax elementsrelated to delta QP and/or chroma QP offsets for the current block ofvideo data after the syntax element that indicates whether a transposeprocess is applied to the palette indices of the palette for the currentblock of video data. In this way, video encoder 20 and/or video decoder30 may code a larger group of syntax elements using bypass mode, whichmay increase CABAC throughput.

In some examples, the one or more syntax elements related to delta QPfor the current block of video data may include a syntax elements thatspecifies the absolute value of a difference between a luma QP for thecurrent block of video data and a predictor of the luma QP for thecurrent block (e.g., cu_qp_delta_palette_abs), and a syntax element thatspecifies a sign of the difference between the luma QP for the currentblock of video data and the predictor of the luma QP for the currentblock (e.g., cu_qp_delta_palette_sign_flag). In some examples, the oneor more syntax elements related to chroma QP offsets for the currentblock of video data may include a syntax element that indicates whetherentries in one or more offset lists are added to the luma QP for thecurrent block to determine chroma QPs for the current block (e.g.,cu_chroma_qp_palette_offset_flag), and a syntax element that specifiesan index of an entry in each of the one or more offset lists that areadded to the luma QP for the current block to determine chroma QPs forthe current block (e.g., cu_chroma_qp_palette_offset_idx). As such,video encoder 20 and/or video decoder 30 may each be configured to codea palette_transpose_flag syntax element at a first position in abitstream and code a cu_qp_delta_palette_abs syntax element, acu_qp_delta_palette_sign_flag syntax element, acu_chroma_qp_palette_offset_flag syntax element, and acu_chroma_qp_palette_offset_idx syntax element at a second position inthe bitstream that is after the first position.

FIG. 2 is a block diagram illustrating an example video encoder 20 thatmay implement the techniques of this disclosure. FIG. 2 is provided forpurposes of explanation and should not be considered limiting of thetechniques as broadly exemplified and described in this disclosure. Forpurposes of explanation, this disclosure describes video encoder 20 inthe context of HEVC coding. However, the techniques of this disclosuremay be applicable to other coding standards or methods.

Video encoder 20 represents an example of a device that may beconfigured to perform techniques for palette-based video coding inaccordance with various examples described in this disclosure. Forexample, video encoder 20 may be configured to selectively code variousblocks of video data, such as CU's or PU's in HEVC coding, using eitherpalette-based coding or non-palette based coding. Non-palette basedcoding modes may refer to various inter-predictive temporal coding modesor intra-predictive spatial coding modes, such as the various codingmodes specified by the HEVC Standard. Video encoder 20, in one example,may be configured to generate a palette having entries indicating pixelvalues, select pixel values in a palette to represent pixels values ofat least some positions of a block of video data, and signal informationassociating at least some of the positions of the block of video datawith entries in the palette corresponding, respectively, to the selectedpixel values. The signaled information may be used by video decoder 30to decode video data.

In the example of FIG. 2, video encoder 20 includes a predictionprocessing unit 100, a residual generation unit 102, a transformprocessing unit 104, a quantization unit 106, an inverse quantizationunit 108, an inverse transform processing unit 110, a reconstructionunit 112, a filter unit 114, a decoded picture buffer 116, and anentropy encoding unit 118. Prediction processing unit 100 includes aninter-prediction processing unit 120 and an intra-prediction processingunit 126. Inter-prediction processing unit 120 includes a motionestimation unit and a motion compensation unit (not shown). Videoencoder 20 also includes a palette-based encoding unit 122 configured toperform various aspects of the palette-based coding techniques describedin this disclosure. In other examples, video encoder 20 may includemore, fewer, or different functional components.

Video encoder 20 may receive video data. Video encoder 20 may encodeeach CTU in a slice of a picture of the video data. Each of the CTUs maybe associated with equally-sized luma coding tree blocks (CTBs) andcorresponding CTBs of the picture. As part of encoding a CTU, predictionprocessing unit 100 may perform quad-tree partitioning to divide theCTBs of the CTU into progressively-smaller blocks. The smaller block maybe coding blocks of CUs. For example, prediction processing unit 100 maypartition a CTB associated with a CTU into four equally-sizedsub-blocks, partition one or more of the sub-blocks into fourequally-sized sub-sub-blocks, and so on.

Video encoder 20 may encode CUs of a CTU to generate encodedrepresentations of the CUs (i.e., coded CUs). As part of encoding a CU,prediction processing unit 100 may partition the coding blocksassociated with the CU among one or more PUs of the CU. Thus, each PUmay be associated with a luma prediction block and corresponding chromaprediction blocks. Video encoder 20 and video decoder 30 may support PUshaving various sizes. As indicated above, the size of a CU may refer tothe size of the luma coding block of the CU and the size of a PU mayrefer to the size of a luma prediction block of the PU. Assuming thatthe size of a particular CU is 2N×2N, video encoder 20 and video decoder30 may support PU sizes of 2N×2N or N×N for intra prediction, andsymmetric PU sizes of 2N×2N, 2N×N, N×2N, N×N, or similar for interprediction. Video encoder 20 and video decoder 30 may also supportasymmetric partitioning for PU sizes of 2N×nU, 2N×nD, nL×2N, and nR×2Nfor inter prediction.

Inter-prediction processing unit 120 may generate predictive data for aPU by performing inter prediction on each PU of a CU. The predictivedata for the PU may include a predictive sample blocks of the PU andmotion information for the PU. Inter-prediction processing unit 120 mayperform different operations for a PU of a CU depending on whether thePU is in an I slice, a P slice, or a B slice. In an I slice, all PUs areintra predicted. Hence, if the PU is in an I slice, inter-predictionprocessing unit 120 does not perform inter prediction on the PU. Thus,for blocks encoded in I-mode, the predicted block is formed usingspatial prediction from previously-encoded neighboring blocks within thesame frame.

If a PU is in a P slice, the motion estimation unit of inter-predictionprocessing unit 120 may search the reference pictures in a list ofreference pictures (e.g., “RefPicList0”) for a reference region for thePU. The reference region for the PU may be a region, within a referencepicture, that contains sample blocks that most closely corresponds tothe sample blocks of the PU. The motion estimation unit may generate areference index that indicates a position in RefPicList0 of thereference picture containing the reference region for the PU. Inaddition, the motion estimation unit may generate an MV that indicates aspatial displacement between a coding block of the PU and a referencelocation associated with the reference region. For instance, the MV maybe a two-dimensional vector that provides an offset from the coordinatesin the current decoded picture to coordinates in a reference picture.The motion estimation unit may output the reference index and the MV asthe motion information of the PU. The motion compensation unit ofinter-prediction processing unit 120 may generate the predictive sampleblocks of the PU based on actual or interpolated samples at thereference location indicated by the motion vector of the PU.

If a PU is in a B slice, the motion estimation unit may performuni-prediction or bi-prediction for the PU. To perform uni-predictionfor the PU, the motion estimation unit may search the reference picturesof RefPicList0 or a second reference picture list (“RefPicList1”) for areference region for the PU. The motion estimation unit may output, asthe motion information of the PU, a reference index that indicates aposition in RefPicList0 or RefPicList1 of the reference picture thatcontains the reference region, an MV that indicates a spatialdisplacement between a sample block of the PU and a reference locationassociated with the reference region, and one or more predictiondirection indicators that indicate whether the reference picture is inRefPicList0 or RefPicList1. The motion compensation unit ofinter-prediction processing unit 120 may generate the predictive sampleblocks of the PU based at least in part on actual or interpolatedsamples at the reference region indicated by the motion vector of thePU.

To perform bi-directional inter prediction for a PU, the motionestimation unit may search the reference pictures in RefPicList0 for areference region for the PU and may also search the reference picturesin RefPicList1 for another reference region for the PU. The motionestimation unit may generate reference picture indexes that indicatepositions in RefPicList0 and RefPicList1 of the reference pictures thatcontain the reference regions. In addition, the motion estimation unitmay generate MVs that indicate spatial displacements between thereference location associated with the reference regions and a sampleblock of the PU. The motion information of the PU may include thereference indexes and the MVs of the PU. The motion compensation unitmay generate the predictive sample blocks of the PU based at least inpart on actual or interpolated samples at the reference region indicatedby the motion vector of the PU.

In accordance with various examples of this disclosure, video encoder 20may be configured to perform palette-based coding. With respect to theHEVC framework, as an example, the palette-based coding techniques maybe configured to be used as a coding unit (CU) mode. In other examples,the palette-based coding techniques may be configured to be used as a PUmode in the framework of HEVC. Accordingly, all of the disclosedprocesses described herein (throughout this disclosure) in the contextof a CU mode may, additionally or alternatively, apply to PU. However,these HEVC-based examples should not be considered a restriction orlimitation of the palette-based coding techniques described herein, assuch techniques may be applied to work independently or as part of otherexisting or yet to be developed systems/standards. In these cases, theunit for palette coding can be square blocks, rectangular blocks, oreven regions of non-rectangular shape.

Palette-based encoding unit 122, for example, may perform palette-basedencoding when a palette-based encoding mode is selected, e.g., for a CUor PU. For example, palette-based encoding unit 122 may be configured togenerate a palette having entries indicating pixel values, select pixelvalues in a palette to represent pixels values of at least somepositions of a block of video data, and signal information associatingat least some of the positions of the block of video data with entriesin the palette corresponding, respectively, to the selected pixelvalues. Although various functions are described as being performed bypalette-based encoding unit 122, some or all of such functions may beperformed by other processing units, or a combination of differentprocessing units.

Palette-based encoding unit 122 may generate syntax elements to define apalette for a block of video data. Some example syntax elements whichpalette-based encoding unit 122 may generate to define a current palettefor a current block of video data include, but are not limited to, asyntax element that indicates whether a transpose process is applied topalette indices of the current palette (e.g., palette_transpose_flag),one or more syntax elements related to delta quantization parameter (QP)(e.g., cu_qp_delta_palette_abs, cu_qp_delta_palette_sign_flag,cu_chroma_qp_palette_offset_flag, and/orcu_chroma_qp_palette_offset_idx), one or more syntax elements related tochroma QP offsets for the current block of video data, one or moresyntax elements that indicate a number of zeros that precede a non-zeroentry in an array that indicates whether entries from a predictorpalette are reused in the current palette (e.g., palette_predictor_run),one or more syntax elements that indicate a number of entries in thecurrent palette that are explicitly signalled (e.g.,num_signalled_palette_entries), one or more syntax elements thatindicate a value of a component in a palette entry in the currentpalette (e.g., palette_entry), one or more syntax elements that indicatewhether the current block of video data includes at least one escapecoded sample (e.g., palette_escape_val_present_flag), one or more syntaxelements that indicate a number of entries in the current palette thatare explicitly signalled or inferred (e.g., num_palette_indices_idc),and one or more syntax elements that indicate indices in an array ofcurrent palette entries (e.g., palette_index_idc). Palette-basedencoding unit 122 may output the generated syntax elements that definethe current palette for the current block to one or more othercomponents of video encoder 20, such as entropy encoding unit 118.

Accordingly, video encoder 20 may be configured to encode blocks ofvideo data using palette-based code modes as described in thisdisclosure. Video encoder 20 may selectively encode a block of videodata using a palette coding mode, or encode a block of video data usinga different mode, e.g., such an HEVC inter-predictive orintra-predictive coding mode. The block of video data may be, forexample, a CU or PU generated according to an HEVC coding process. Avideo encoder 20 may encode some blocks with inter-predictive temporalprediction or intra-predictive spatial coding modes and decode otherblocks with the palette-based coding mode.

Intra-prediction processing unit 126 may generate predictive data for aPU by performing intra prediction on the PU. The predictive data for thePU may include predictive sample blocks for the PU and various syntaxelements. Intra-prediction processing unit 126 may perform intraprediction on PUs in I slices, P slices, and B slices.

To perform intra prediction on a PU, intra-prediction processing unit126 may use multiple intra prediction modes to generate multiple sets ofpredictive data for the PU. To use an intra-prediction mode to generatea set of predictive data for the PU, intra-prediction processing unit126 may extend samples from sample blocks of neighboring PUs across thesample blocks of the PU in a direction associated with the intraprediction mode. The neighboring PUs may be above, above and to theright, above and to the left, or to the left of the PU, assuming aleft-to-right, top-to-bottom encoding order for PUs, CUs, and CTUs.Intra-prediction processing unit 126 may use various numbers of intraprediction modes, e.g., 33 directional intra prediction modes. In someexamples, the number of intra prediction modes may depend on the size ofthe region associated with the PU.

Prediction processing unit 100 may select the predictive data for PUs ofa CU from among the predictive data generated by inter-predictionprocessing unit 120 for the PUs or the predictive data generated byintra-prediction processing unit 126 for the PUs. In some examples,prediction processing unit 100 selects the predictive data for the PUsof the CU based on rate/distortion metrics of the sets of predictivedata. The predictive sample blocks of the selected predictive data maybe referred to herein as the selected predictive sample blocks.

Residual generation unit 102 may generate, based on the luma, Cb and Crcoding block of a CU and the selected predictive luma, Cb and Cr blocksof the PUs of the CU, a luma, Cb and Cr residual blocks of the CU. Forinstance, residual generation unit 102 may generate the residual blocksof the CU such that each sample in the residual blocks has a value equalto a difference between a sample in a coding block of the CU and acorresponding sample in a corresponding selected predictive sample blockof a PU of the CU.

Transform processing unit 104 may perform quad-tree partitioning topartition the residual blocks associated with a CU into transform blocksassociated with TUs of the CU. Thus, a TU may be associated with a lumatransform block and two chroma transform blocks. The sizes and positionsof the luma and chroma transform blocks of TUs of a CU may or may not bebased on the sizes and positions of prediction blocks of the PUs of theCU. A quad-tree structure known as a “residual quad-tree” (RQT) mayinclude nodes associated with each of the regions. The TUs of a CU maycorrespond to leaf nodes of the RQT.

Transform processing unit 104 may generate transform coefficient blocksfor each TU of a CU by applying one or more transforms to the transformblocks of the TU. Transform processing unit 104 may apply varioustransforms to a transform block associated with a TU. For example,transform processing unit 104 may apply a discrete cosine transform(DCT), a directional transform, or a conceptually similar transform to atransform block. In some examples, transform processing unit 104 doesnot apply transforms to a transform block. In such examples, thetransform block may be treated as a transform coefficient block.

Quantization unit 106 may quantize the transform coefficients in acoefficient block. The quantization process may reduce the bit depthassociated with some or all of the transform coefficients. For example,an n-bit transform coefficient may be rounded down to an m-bit transformcoefficient during quantization, where n is greater than m. Quantizationunit 106 may quantize a coefficient block associated with a TU of a CUbased on a quantization parameter (QP) value associated with the CU.Video encoder 20 may adjust the degree of quantization applied to thecoefficient blocks associated with a CU by adjusting the QP valueassociated with the CU. Quantization may introduce loss of information,thus quantized transform coefficients may have lower precision than theoriginal ones.

Inverse quantization unit 108 and inverse transform processing unit 110may apply inverse quantization and inverse transforms to a coefficientblock, respectively, to reconstruct a residual block from thecoefficient block. Reconstruction unit 112 may add the reconstructedresidual block to corresponding samples from one or more predictivesample blocks generated by prediction processing unit 100 to produce areconstructed transform block associated with a TU. By reconstructingtransform blocks for each TU of a CU in this way, video encoder 20 mayreconstruct the coding blocks of the CU.

Filter unit 114 may perform one or more deblocking operations to reduceblocking artifacts in the coding blocks associated with a CU. Decodedpicture buffer 116 may store the reconstructed coding blocks afterfilter unit 114 performs the one or more deblocking operations on thereconstructed coding blocks. Inter-prediction processing unit 120 mayuse a reference picture that contains the reconstructed coding blocks toperform inter prediction on PUs of other pictures. In addition,intra-prediction processing unit 126 may use reconstructed coding blocksin decoded picture buffer 116 to perform intra prediction on other PUsin the same picture as the CU.

Entropy encoding unit 118 may receive data from other functionalcomponents of video encoder 20. For example, entropy encoding unit 118may receive coefficient blocks from quantization unit 106 and mayreceive syntax elements from prediction processing unit 100. Entropyencoding unit 118 may perform one or more entropy encoding operations onthe data to generate entropy-encoded data. For example, entropy encodingunit 118 may perform a context-adaptive variable length coding (CAVLC)operation, a CABAC operation, a variable-to-variable (V2V) length codingoperation, a syntax-based context-adaptive binary arithmetic coding(SBAC) operation, a Probability Interval Partitioning Entropy (PIPE)coding operation, an Exponential-Golomb encoding operation, or anothertype of entropy encoding operation on the data. Video encoder 20 mayoutput a bitstream that includes entropy-encoded data generated byentropy encoding unit 118. For instance, the bitstream may include datathat represents a RQT for a CU.

As discussed above, palette-based encoding unit 122 may output thegenerated syntax elements that define the current palette for thecurrent block to entropy encoding unit 118. Entropy encoding unit 118may encode one or more bins of the syntax elements received frompalette-based encoding unit 122 using CABAC with contexts and one ormore bins of the syntax elements received from palette-based encodingunit 122 using CABAC without contexts (i.e., bypass mode). In someexamples, entropy encoding unit 118 may encode the bins of the syntaxelements using contexts or bypass mode as defined above in Table 2.

As discussed above, it may be desirable to group bypass coded binstogether to increase CABAC throughput. In SCC Draft 3, the bins of thepalette_predictor_run, num_signalled_palette_entries, palette_entry, andpalette_escape_val_present_flag syntax elements are bypass coded and aregrouped together. However, while the bins of thenum_palette_indices_idc, and palette_index_idc syntax elements are alsobypass coded, they are not grouped with the bins of thepalette_predictor_run, num_signalled_palette_entries, palette_entry, andpalette_escape_val_present_flag syntax elements. Instead, in HEVC SCCDraft 3, the num_palette_indices_idc, and palette_index_idc syntaxelements are separated from the palette_predictor_run,num_signalled_palette_entries, palette_entry, andpalette_escape_val_present_flag syntax elements by one or more syntaxelements related to delta quantization parameter (QP) and/or chroma QPoffsets for a current block of video data (i.e.,cu_qp_delta_palette_abs, cu_qp_delta_palette_sign_flag,cu_chroma_qp_palette_offset_flag, and cu_chroma_qp_palette_offset_idx)and a syntax element that indicates whether a transpose process isapplied to the palette indices of the palette for the current block ofvideo data (i.e., palette_transpose_flag).

In accordance with one or more techniques of this disclosure, entropyencoding unit 118 may encode the syntax elements used to define acurrent palette such that syntax elements that are encoded using bypassmode are consecutively encoded. For instance, as opposed to separatingthe bins of the palette_predictor_run, num_signalled_palette_entries,palette_entry, and palette_escape_val_present_flag syntax elements andthe bins of the num_palette_indices_idc, and palette_index_idc syntaxelements, entropy encoding unit 118 may encode one or more syntaxelements related to delta QP and/or chroma QP offsets for the currentblock of video data after a syntax element that indicates whether atranspose process is applied to the palette indices of the palette forthe current block of video data such that the bins of thepalette_predictor_run, num_signalled_palette_entries, palette_entry, andpalette_escape_val_present_flag, num_palette_indices_idc, andpalette_index_idc syntax elements are grouped together. In this way, theCABAC throughput of entropy encoding unit 118 may be increased.

FIG. 3 is a block diagram illustrating an example video decoder 30 thatis configured to implement the techniques of this disclosure. FIG. 3 isprovided for purposes of explanation and is not limiting on thetechniques as broadly exemplified and described in this disclosure. Forpurposes of explanation, this disclosure describes video decoder 30 inthe context of HEVC coding. However, the techniques of this disclosuremay be applicable to other coding standards or methods.

Video decoder 30 represents an example of a device that may beconfigured to perform techniques for palette-based video coding inaccordance with various examples described in this disclosure. Forexample, video decoder 30 may be configured to selectively decodevarious blocks of video data, such as CU's or PU's in HEVC coding, usingeither palette-based coding or non-palette based coding. Non-palettebased coding modes may refer to various inter-predictive temporal codingmodes or intra-predictive spatial coding modes, such as the variouscoding modes specified by the HEVC Standard. Video decoder 30, in oneexample, may be configured to generate a palette having entriesindicating pixel values, receive information associating at least somepositions of a block of video data with entries in the palette, selectpixel values in the palette based on the information, and reconstructpixel values of the block based on the selected pixel values.

In the example of FIG. 3, video decoder 30 includes an entropy decodingunit 150, a prediction processing unit 152, an inverse quantization unit154, an inverse transform processing unit 156, a reconstruction unit158, a filter unit 160, and a decoded picture buffer 162. Predictionprocessing unit 152 includes a motion compensation unit 164 and anintra-prediction processing unit 166. Video decoder 30 also includes apalette-based decoding unit 165 configured to perform various aspects ofthe palette-based coding techniques described in this disclosure. Inother examples, video decoder 30 may include more, fewer, or differentfunctional components.

In some examples, video decoder 30 may further include video data memory149. Video data memory 149 may store video data, such as an encodedvideo bitstream, to be decoded by the components of video decoder 30.The video data stored in video data memory 149 may be obtained, forexample, from channel 16, e.g., from a local video source, such as acamera, via wired or wireless network communication of video data, or byaccessing physical data storage media. Video data memory 149 may form acoded picture buffer (CPB) that stores encoded video data from anencoded video bitstream. The CPB may be a reference picture memory thatstores reference video data for use in decoding video data by videodecoder 30, e.g., in intra- or inter-coding modes. Video data memory 149may be formed by any of a variety of memory devices, such as dynamicrandom access memory (DRAM), including synchronous DRAM (SDRAM),magnetoresistive RAM (MRAM), resistive RAM (RRAM), or other types ofmemory devices. Video data memory 149 and decoded picture buffer 162 maybe provided by the same memory device or separate memory devices. Invarious examples, video data memory 149 may be on-chip with othercomponents of video decoder 30, or off-chip relative to thosecomponents.

A coded picture buffer (CPB) may receive and store encoded video data(e.g., NAL units) of a bitstream. Entropy decoding unit 150 may receiveencoded video data (e.g., NAL units) from the CPB and parse the NALunits to decode syntax elements. Entropy decoding unit 150 may entropydecode entropy-encoded syntax elements in the NAL units. Predictionprocessing unit 152, inverse quantization unit 154, inverse transformprocessing unit 156, reconstruction unit 158, and filter unit 160 maygenerate decoded video data based on the syntax elements extracted fromthe bitstream.

The NAL units of the bitstream may include coded slice NAL units. Aspart of decoding the bitstream, entropy decoding unit 150 may extractand entropy decode syntax elements from the coded slice NAL units. Eachof the coded slices may include a slice header and slice data. The sliceheader may contain syntax elements pertaining to a slice. The syntaxelements in the slice header may include a syntax element thatidentifies a PPS associated with a picture that contains the slice.

In addition to decoding syntax elements from the bitstream, videodecoder 30 may perform a reconstruction operation on a non-partitionedCU. To perform the reconstruction operation on a non-partitioned CU,video decoder 30 may perform a reconstruction operation on each TU ofthe CU. By performing the reconstruction operation for each TU of theCU, video decoder 30 may reconstruct residual blocks of the CU.

As part of performing a reconstruction operation on a TU of a CU,inverse quantization unit 154 may inverse quantize, i.e., de-quantize,coefficient blocks associated with the TU. Inverse quantization unit 154may use a QP value associated with the CU of the TU to determine adegree of quantization and, likewise, a degree of inverse quantizationfor inverse quantization unit 154 to apply. That is, the compressionratio, i.e., the ratio of the number of bits used to represent anoriginal sequence and the compressed sequence, may be controlled byadjusting the value of the QP used when quantizing transformcoefficients. The compression ratio may also depend on the method ofentropy coding employed.

After inverse quantization unit 154 inverse quantizes a coefficientblock, inverse transform processing unit 156 may apply one or moreinverse transforms to the coefficient block in order to generate aresidual block associated with the TU. For example, inverse transformprocessing unit 156 may apply an inverse DCT, an inverse integertransform, an inverse Karhunen-Loeve transform (KLT), an inverserotational transform, an inverse directional transform, or anotherinverse transform to the coefficient block.

If a PU is encoded using intra prediction, intra-prediction processingunit 166 may perform intra prediction to generate predictive blocks forthe PU. Intra-prediction processing unit 166 may use an intra predictionmode to generate the predictive luma, Cb and Cr blocks for the PU basedon the prediction blocks of spatially-neighboring PUs. Intra-predictionprocessing unit 166 may determine the intra prediction mode for the PUbased on one or more syntax elements decoded from the bitstream.

Prediction processing unit 152 may construct a first reference picturelist (RefPicList0) and a second reference picture list (RefPicList1)based on syntax elements extracted from the bitstream. Furthermore, if aPU is encoded using inter prediction, entropy decoding unit 150 mayextract motion information for the PU. Motion compensation unit 164 maydetermine, based on the motion information of the PU, one or morereference regions for the PU. Motion compensation unit 164 may generate,based on samples blocks at the one or more reference blocks for the PU,predictive luma, Cb and Cr blocks for the PU.

Reconstruction unit 158 may use the luma, Cb and Cr transform blocksassociated with TUs of a CU and the predictive luma, Cb and Cr blocks ofthe PUs of the CU, i.e., either intra-prediction data orinter-prediction data, as applicable, to reconstruct the luma, Cb and Crcoding blocks of the CU. For example, reconstruction unit 158 may addsamples of the luma, Cb and Cr transform blocks to corresponding samplesof the predictive luma, Cb and Cr blocks to reconstruct the luma, Cb andCr coding blocks of the CU.

Filter unit 160 may perform a deblocking operation to reduce blockingartifacts associated with the luma, Cb and Cr coding blocks of the CU.Video decoder 30 may store the luma, Cb and Cr coding blocks of the CUin decoded picture buffer 162. Decoded picture buffer 162 may providereference pictures for subsequent motion compensation, intra prediction,and presentation on a display device, such as display device 32 ofFIG. 1. For instance, video decoder 30 may perform, based on the luma,Cb and Cr blocks in decoded picture buffer 162, intra prediction orinter prediction operations on PUs of other CUs. In this way, videodecoder 30 may extract, from the bitstream, transform coefficient levelsof the significant luma coefficient block, inverse quantize thetransform coefficient levels, apply a transform to the transformcoefficient levels to generate a transform block, generate, based atleast in part on the transform block, a coding block, and output thecoding block for display.

In accordance with various examples of this disclosure, video decoder 30may be configured to perform palette-based coding. Palette-baseddecoding unit 165, for example, may perform palette-based decoding whena palette-based decoding mode is selected, e.g., for a CU or PU. Forexample, palette-based decoding unit 165 may be configure to generate apalette having entries indicating pixel values, receive informationassociating at least some positions of a block of video data withentries in the palette, select pixel values in the palette based on theinformation, and reconstruct pixel values of the block based on theselected pixel values. Although various functions are described as beingperformed by palette-based decoding unit 165, some or all of suchfunctions may be performed by other processing units, or a combinationof different processing units.

Palette-based decoding unit 165 may receive palette coding modeinformation, and perform the above operations when the palette codingmode information indicates that the palette coding mode applies to theblock. When the palette coding mode information indicates that thepalette coding mode does not apply to the block, or when other modeinformation indicates the use of a different mode, prediction processingunit 152 decodes the block of video data using a non-palette basedcoding mode, e.g., such an HEVC inter-predictive mode using motioncompensation unit 164 or intra-predictive coding mode usingintra-prediction processing unit 166, when the palette coding modeinformation indicates that the palette coding mode does not apply to theblock. The block of video data may be, for example, a CU or PU generatedaccording to an HEVC coding process. Video decoder 30 may decode someblocks with inter-predictive temporal prediction or intra-predictivespatial coding modes and decode other blocks with the palette-basedcoding mode. The palette-based coding mode may comprise one of aplurality of different palette-based coding modes, or there may be asingle palette-based coding mode.

The palette coding mode information received by palette-based decodingunit 165 may comprise a palette mode syntax element, such as a flag. Afirst value of the palette mode syntax element indicates that thepalette coding mode applies to the block and a second value of thepalette mode syntax element indicates that the palette coding mode doesnot apply to the block of video data. Palette-based decoding unit 165may receive the palette coding mode information at one or more of apredictive unit level, a coding unit level, a slice level, or a picturelevel, or may receive the palette coding mode information in at leastone of picture parameter set (PPS), sequence parameter set (SPS) orvideo parameter set (VPS).

In some examples, palette-based decoding unit 165 may infer the palettecoding mode information based on one or more of a size of the codingblock, a frame type, a color space, a color component, a frame size, aframe rate, a layer id in scalable video coding or a view id inmulti-view coding associated with the block of video data.

Palette-based decoding unit 165 also may be configured to receiveinformation defining at least some of the entries in the palette withvideo data, and generate the palette based at least in part on thereceived information. The size of the palette may be fixed or variable.In some cases, the size of the palette is variable and is adjustablebased on information signaled with the video data. The signaledinformation may specify whether an entry in the palette is a last entryin the palette. Also, in some cases, the palette may have a maximumsize.

The palette may be a single palette including entries indicating pixelvalues for a luma component and chroma components of the block. In thiscase, each entry in the palette is a triple entry indicating pixelvalues for the luma component and two chroma components. Alternatively,the palette comprises a luma palette including entries indicating pixelvalues of a luma component of the block, and chroma palettes includingentries indicating pixel values for respective chroma components of theblock.

In some examples, palette-based decoding unit 165 may generate thepalette by predicting the entries in the palette based on previouslyprocessed data. The previously processed data may include palettes, orinformation from palettes, for previously decoded neighboring blocks.Palette-based decoding unit 165 may receive a prediction syntax elementindicating whether the entries in the palette are to be predicted. Theprediction syntax element may include a plurality of prediction syntaxelements indicating, respectively, whether entries in palettes for lumaand chroma components are to be predicted.

Palette-based decoding unit 165 may, in some examples, predict at leastsome of the entries in the palette based on entries in a palette for aleft neighbor block or a top neighbor block in a slice or picture. Inthis case, the entries in the palette that are predicted based onentries in either a palette for the left neighbor block or the topneighbor block may be predicted by palette-based decoding unit 165 basedon a syntax element that indicates selection of the left neighbor blockor the top neighbor block for prediction. The syntax element may be aflag having a value that indicates selection of the left neighbor blockor the top neighbor block for prediction.

In some examples, palette-based decoding unit 165 may receive one ormore prediction syntax elements that indicate whether at least someselected entries in the palette, on an entry-by-entry basis, are to bepredicted, and generate the entries accordingly. Palette-based decodingunit 165 may predict some of the entries and receive informationdirectly specifying other entries in the palette.

Information, received by palette-based decoding unit 165, associating atleast some positions of a block of video data with entries in thepalette, may comprise map information including palette index values forat least some of the positions in the block, wherein each of the paletteindex values corresponds to one of the entries in the palette. The mapinformation may include one or more run syntax elements that eachindicate a number of consecutive positions in the block having the samepalette index value.

In some examples, palette-based decoding unit 165 may receiveinformation indicating line copying whereby palette entries for a lineof positions in the block are copied from palette entries for anotherline of positions in the block. Palette-based decoding unit 165 may usethis information to perform line copying to determine entries in thepalette for various positions of a block. The line of positions maycomprise a row, a portion of a row, a column or a portion of a column ofpositions of the block.

Palette-based decoding unit 165 may generate the palette in part byreceiving pixel values for one or more positions of the block, andadding the pixel values to entries in the palette to dynamicallygenerate at least a portion the palette on-the-fly. Adding the pixelvalues may comprise adding the pixel values to an initial palettecomprising an initial set of entries, or to an empty palette that doesnot include an initial set of entries. In some examples, addingcomprises adding the pixel values to add new entries to an initialpalette comprising an initial set of entries or fill existing entries inthe initial palette, or replacing or changing pixel values of entries inthe initial palette.

In some examples, the palette may be a quantized palette in which apixel value selected from the palette for one of the positions in theblock is different from an actual pixel value of the position in theblock, such that the decoding process is lossy. For example, the samepixel value may be selected from the palette for two different positionshaving different actual pixel values.

As discussed above, palette-based decoding unit 165 may receiveinformation that defines a palette for a current block of video data.For instance, palette-based decoding unit 165 may receive a plurality ofsyntax elements from entropy decoding unit 150. In some examples,entropy decoding unit 150 may decode the plurality of syntax elementsfrom a coded video bitstream according to a syntax table. As oneexample, entropy decoding unit 150 may decode the plurality of syntaxelements from a coded video bitstream in accordance with the palettesyntax table of HEVC SCC Draft 3, which is reproduced above in Table 1.However, as discussed above, the arrangement of syntax elements in HEVCSCC Draft 3 may not be optimal. In particular, the arrangement of syntaxelements in HEVC SCC Draft 3 does not maximize the number of bypass modecoded syntax elements that are grouped together, which may decreaseCABAC throughput.

In accordance with one or more techniques of this disclosure, entropydecoding unit 150 may decode the syntax elements used to define acurrent palette such that additional bypass mode coded syntax elementsare grouped together. For instance, as opposed to separating the bins ofthe palette_predictor_run, num_signalled_palette_entries, palette_entry,and palette_escape_val_present_flag syntax elements and the bins of thenum_palette_indices_idc, and palette_index_idc syntax elements, entropydecoding unit 150 may decode one or more syntax elements related todelta QP and/or chroma QP offsets for the current block of video dataafter a syntax element that indicates whether a transpose process isapplied to the palette indices of the palette for the current block ofvideo data such that the bins of the palette_predictor_run,num_signalled_palette_entries, palette_entry, andpalette_escape_val_present_flag, num_palette_indices_idc, andpalette_index_idc syntax elements are grouped together. As one example,entropy decoding unit 150 may decode the syntax elements used to definethe current palette in the order shown above in Table 4. As anotherexample, entropy decoding unit 150 may decode the syntax elements usedto define the current palette in the order shown above in Table 5. Inthis way, the CABAC throughput of entropy decoding unit 150 may beincreased.

FIG. 4 is a conceptual diagram illustrating an example of determining apalette for coding video data, consistent with techniques of thisdisclosure. The example of FIG. 4 includes a picture 178 having a firstcoding unit (CU) 180 that is associated with first palettes 184 and asecond CU 188 that is associated with second palettes 192. As describedin greater detail below and in accordance with the techniques of thisdisclosure, second palettes 192 are based on first palettes 184. Picture178 also includes block 196 coded with an intra-prediction coding modeand block 200 that is coded with an inter-prediction coding mode.

The techniques of FIG. 4 are described in the context of video encoder20 (FIG. 1 and FIG. 2) and video decoder 30 (FIG. 1 and FIG. 3) and withrespect to the HEVC Standard for purposes of explanation. However, itshould be understood that the techniques of this disclosure are notlimited in this way, and may be applied by other video coding processorsand/or devices in other video coding processes and/or standards.

In general, a palette refers to a number of pixel values that aredominant and/or representative for a CU currently being coded, such asCU 188 in the example of FIG. 4. First palettes 184 and second palettes192 are shown as including multiple palettes. In some examples, a videocoder (such as video encoder 20 or video decoder 30) may code palettesseparately for each color component of a CU. For example, video encoder20 may encode a palette for a luma (Y) component of a CU, anotherpalette for a chroma (U) component of the CU, and yet another palettefor the chroma (V) component of the CU. In this example, entries of theY palette may represent Y values of pixels of the CU, entries of the Upalette may represent U values of pixels of the CU, and entries of the Vpalette may represent V values of pixels of the CU. In another example,video encoder 20 may encode a palette for a luma (Y) component of a CU,and another palette for two components (U, V) of the CU. In thisexample, entries of the Y palette may represent Y values of pixels ofthe CU, and entries of the U-V palette may represent U-V value pairs ofpixels of the CU.

In other examples, video encoder 20 may encode a single palette for allcolor components of a CU. In this example, video encoder 20 may encode apalette having an i-th entry that is a triple value, including Yi, Ui,and Vi. In this case, the palette includes values for each of thecomponents of the pixels. Accordingly, the representation of palettes184 and 192 as a set of palettes having multiple individual palettes ismerely one example and not intended to be limiting.

In the example of FIG. 4, first palettes 184 includes three entries202-206 having entry index value 1, entry index value 2, and entry indexvalue 3, respectively. Entries 202-206 relate the index values to pixelvalues including pixel value A, pixel value B, and pixel value C,respectively. As described herein, rather than coding the actual pixelvalues of first CU 180, a video coder (such as video encoder 20 or videodecoder 30) may use palette-based coding to code the pixels of the blockusing the indices 1-3. That is, for each pixel position of first CU 180,video encoder 20 may encode an index value for the pixel, where theindex value is associated with a pixel value in one or more of firstpalettes 184. Video decoder 30 may obtain the index values from abitstream and reconstruct the pixel values using the index values andone or more of first palettes 184. Thus, first palettes 184 aretransmitted by video encoder 20 in an encoded video data bitstream foruse by video decoder 30 in palette-based decoding. In general, one ormore palettes may be transmitted for each CU or may be shared amongdifferent CUs.

Video encoder 20 and video decoder 30 may determine second palettes 192based on first palettes 184. For example, video encoder 20 may encode apred_palette_flag for each CU (including, as an example, second CU 188)to indicate whether the palette for the CU is predicted from one or morepalettes associated with one or more other CUs, such as neighboring CUs(spatially or based on scan order) or the most frequent samples of acausal neighbor. For example, when the value of such a flag is equal toone, video decoder 30 may determine that second palettes 192 for secondCU 188 are predicted from one or more already decoded palettes andtherefore no new palettes for second CU 188 are included in a bitstreamcontaining the pred_palette_flag. When such a flag is equal to zero,video decoder 30 may determine that palette 192 for second CU 188 isincluded in the bitstream as a new palette. In some examples,pred_palette_flag may be separately coded for each different colorcomponent of a CU (e.g., three flags, one for Y, one for U, and one forV, for a CU in YUV video). In other examples, a single pred_palette_flagmay be coded for all color components of a CU.

In the example above, the pred_palette_flag is signaled per-CU toindicate whether any of the entries of the palette for the current blockare predicted. In some examples, one or more syntax elements may besignaled on a per-entry basis. That is, a flag may be signaled for eachentry of a palette predictor to indicate whether that entry is presentin the current palette. As noted above, if a palette entry is notpredicted, the palette entry may be explicitly signaled.

When determining second palettes 192 relative to first palettes 184(e.g., pred_palette_flag is equal to one), video encoder 20 and/or videodecoder 30 may locate one or more blocks from which the predictivepalettes, in this example first palettes 184, are determined. Thepredictive palettes may be associated with one or more neighboring CUsof the CU currently being coded (e.g., such as neighboring CUs(spatially or based on scan order) or the most frequent samples of acausal neighbor), i.e., second CU 188. The palettes of the one or moreneighboring CUs may be associated with a predictor palette. In someexamples, such as the example illustrated in FIG. 4, video encoder 20and/or video decoder 30 may locate a left neighboring CU, first CU 180,when determining a predictive palette for second CU 188. In otherexamples, video encoder 20 and/or video decoder 30 may locate one ormore CUs in other positions relative to second CU 188, such as an upperCU, CU 196.

Video encoder 20 and/or video decoder 30 may determine a CU for paletteprediction based on a hierarchy. For example, video encoder 20 and/orvideo decoder 30 may initially identify the left neighboring CU, firstCU 180, for palette prediction. If the left neighboring CU is notavailable for prediction (e.g., the left neighboring CU is coded with amode other than a palette-based coding mode, such as an intra-predictionmore or intra-prediction mode, or is located at the left-most edge of apicture or slice) video encoder 20 and/or video decoder 30 may identifythe upper neighboring CU, CU 196. Video encoder 20 and/or video decoder30 may continue searching for an available CU according to apredetermined order of locations until locating a CU having a paletteavailable for palette prediction. In some examples, video encoder 20and/or video decoder 30 may determine a predictive palette based onmultiple blocks and/or reconstructed samples of a neighboring block.

While the example of FIG. 4 illustrates first palettes 184 as predictivepalettes from a single CU, first CU 180, in other examples, videoencoder 20 and/or video decoder 30 may locate palettes for predictionfrom a combination of neighboring CUs. For example, video encoder 20and/or video decoder may apply one or more formulas, functions, rules orthe like to generate a palette based on palettes of one or a combinationof a plurality of neighboring CUs.

In still other examples, video encoder 20 and/or video decoder 30 mayconstruct a candidate list including a number of potential candidatesfor palette prediction. A pruning process may be applied at both videoencoder 20 and video decoder 30 to remove duplicated candidates in thelist. In such examples, video encoder 20 may encode an index to thecandidate list to indicate the candidate CU in the list from which thecurrent CU used for palette prediction is selected (e.g., copies thepalette). Video decoder 30 may construct the candidate list in the samemanner, decode the index, and use the decoded index to select thepalette of the corresponding CU for use with the current CU.

In an example for purposes of illustration, video encoder 20 and videodecoder 30 may construct a candidate list that includes one CU that ispositioned above the CU currently being coded and one CU that ispositioned to the left of the CU currently being coded. In this example,video encoder 20 may encode one or more syntax elements to indicate thecandidate selection. For example, video encoder 20 may encode a flaghaving a value of zero to indicate that the palette for the current CUis copied from the CU positioned to the left of the current CU. Videoencoder 20 may encode the flag having a value of one to indicate thatthe palette for the current CU is copied from the CU positioned abovethe current CU. Video decoder 30 decodes the flag and selects theappropriate CU for palette prediction.

In still other examples, video encoder 20 and/or video decoder 30determine the palette for the CU currently being coded based on thefrequency with which sample values included in one or more otherpalettes occur in one or more neighboring CUs. For example, videoencoder 20 and/or video decoder 30 may track the colors associated withthe most frequently used index values during coding of a predeterminednumber of CUs. Video encoder 20 and/or video decoder 30 may include themost frequently used colors in the palette for the CU currently beingcoded.

In some examples, video encoder 20 and/or video decoder 30 may performentry-wise based palette prediction. For example, video encoder 20 mayencode one or more syntax elements, such as one or more flags, for eachentry of a predictive palette indicating whether the respectivepredictive palette entries are reused in the current palette (e.g.,whether pixel values in a palette of another CU are reused by thecurrent palette). In this example, video encoder 20 may encode a flaghaving a value equal to one for a given entry when the entry is apredicted value from a predictive palette (e.g., a corresponding entryof a palette associated with a neighboring CU). Video encoder 20 mayencode a flag having a value equal to zero for a particular entry toindicate that the particular entry is not predicted from a palette ofanother CU. In this example, video encoder 20 may also encode additionaldata indicating the value of the non-predicted palette entry.

In the example of FIG. 4, second palettes 192 includes four entries208-214 having entry index value 1, entry index value 2, entry indexvalue 3, and entry index 4, respectively. Entries 208-214 relate theindex values to pixel values including pixel value A, pixel value B,pixel value C, and pixel value D, respectively. Video encoder 20 and/orvideo decoder 30 may use any of the above-described techniques to locatefirst CU 180 for purposes of palette prediction and copy entries 1-3 offirst palettes 184 to entries 1-3 of second palettes 192 for codingsecond CU 188. In this way, video encoder 20 and/or video decoder 30 maydetermine second palettes 192 based on first palettes 184. In addition,video encoder 20 and/or video decoder 30 may code data for entry 4 to beincluded with second palettes 192. Such information may include thenumber of palette entries not predicted from a predictor palette and thepixel values corresponding to those palette entries.

In some examples, according to aspects of this disclosure, one or moresyntax elements may indicate whether palettes, such as second palettes192, are predicted entirely from a predictive palette (shown in FIG. 4as first palettes 184, but which may be composed of entries from one ormore blocks) or whether particular entries of second palettes 192 arepredicted. For example, an initial syntax element may indicate whetherall of the entries are predicted. If the initial syntax elementindicates that not all of the entries are predicted (e.g., a flag havinga value of 0), one or more additional syntax elements may indicate whichentries of second palettes 192 are predicted from the predictivepalette.

According to some aspects of this disclosure, certain informationassociated with palette prediction may be inferred from one or morecharacteristics of the data being coded. That is, rather than videoencoder 20 encoding syntax elements (and video decoder 30 decoding suchsyntax elements), video encoder 20 and video decoder 30 may performpalette prediction based on one or more characteristics of the databeing coded.

FIG. 5 is a conceptual diagram illustrating an example of determiningindices to a palette for a block of pixels, consistent with techniquesof this disclosure. For example, FIG. 5 includes a map 240 of indexvalues (values 1, 2, and 3) that relate respective positions of pixelsassociated with the index values to an entry of palettes 244. Palettes244 may be determined in a similar manner as first palettes 184 andsecond palettes 192 described above with respect to FIG. 4.

Again, the techniques of FIG. 5 are described in the context of videoencoder 20 (FIG. 1 and FIG. 2) and video decoder 30 (FIG. 1 and FIG. 3)and with respect to the HEVC video coding standard for purposes ofexplanation. However, it should be understood that the techniques ofthis disclosure are not limited in this way, and may be applied by othervideo coding processors and/or devices in other video coding processesand/or standards.

While map 240 is illustrated in the example of FIG. 5 as including anindex value for each pixel position, it should be understood that inother examples, not all pixel positions may be associated with an indexvalue relating the pixel value to an entry of palettes 244. That is, asnoted above, in some examples, video encoder 20 may encode (and videodecoder 30 may obtain, from an encoded bitstream) an indication of anactual pixel value (or its quantized version) for a position in map 240if the pixel value is not included in palettes 244.

In some examples, video encoder 20 and video decoder 30 may beconfigured to code an additional map indicating which pixel positionsare associated with index values. For example, assume that the (i, j)entry in the map corresponds to the (i, j) position of a CU. Videoencoder 20 may encode one or more syntax elements for each entry of themap (i.e., each pixel position) indicating whether the entry has anassociated index value. For example, video encoder 20 may encode a flaghaving a value of one to indicate that the pixel value at the (i, j)location in the CU is one of the values in palettes 244. Video encoder20 may, in such an example, also encode a palette index (shown in theexample of FIG. 5 as values 1-3) to indicate that pixel value in thepalette and to allow video decoder to reconstruct the pixel value. Ininstances in which palettes 244 include a single entry and associatedpixel value, video encoder 20 may skip the signaling of the index value.Video encoder 20 may encode the flag to have a value of zero to indicatethat the pixel value at the (i, j) location in the CU is not one of thevalues in palettes 244. In this example, video encoder 20 may alsoencode an indication of the pixel value for use by video decoder 30 inreconstructing the pixel value. In some instances, the pixel value maybe coded in a lossy manner.

The value of a pixel in one position of a CU may provide an indicationof values of one or more other pixels in other positions of the CU. Forexample, there may be a relatively high probability that neighboringpixel positions of a CU will have the same pixel value or may be mappedto the same index value (in the case of lossy coding, in which more thanone pixel value may be mapped to a single index value).

Accordingly, video encoder 20 may encode one or more syntax elementsindicating a number of consecutive pixels or index values in a givenscan order that have the same pixel value or index value. As notedabove, the string of like-valued pixel or index values may be referredto herein as a run. In an example for purposes of illustration, if twoconsecutive pixels or indices in a given scan order have differentvalues, the run is equal to zero. If two consecutive pixels or indicesin a given scan order have the same value but the third pixel or indexin the scan order has a different value, the run is equal to one. Forthree consecutive indices or pixels with the same value, the run is two,and so forth. Video decoder 30 may obtain the syntax elements indicatinga run from an encoded bitstream and use the data to determine the numberof consecutive locations that have the same pixel or index value.

The number of indices that may be included in a run may be impacted bythe scan order. For example, consider a raster scan of lines 266, 268,and 270 of map 240. Assuming a horizontal, left to right scan direction(such as a raster scanning order), row 266 includes three index valuesof “1,” two index values of “2,” and three index values of “3.” Row 268includes five index values of “1” and three index values of “3.” In thisexample, for row 266, video encoder 20 may encode syntax elementsindicating that the first value of row 266 (the leftmost value of therow) is 1 with a run of 2, followed by an index value of 2 with a run of1, followed by an index value of 3 with a run of 2. Following the rasterscan, video encoder 20 may then begin coding row 268 with the leftmostvalue. For example, video encoder 20 may encode syntax elementsindicating that the first value of row 268 is 1 with a run of 4,followed by an index value of 3 with a run of 2. Video encoder 20 mayproceed in the same manner with line 270.

Hence, in the raster scan order, the first index of a current line maybe scanned directly after the last index of a previous line. However, insome examples, it may not be desirable to scan the indices in a rasterscan order. For instance, it may not be desirable to scan the indices ina raster scan order where a first line of a block of video data (e.g.,row 266) includes a first pixel adjacent to a first edge of the block ofvideo data (e.g., the left most pixel of row 266, which has an indexvalue of 1) and a last pixel adjacent to a second edge of the block ofvideo data (e.g., the right most pixel of row 266, which has an indexvalue of 3), a second line of the block of video data (e.g., row 268)includes a first pixel adjacent to the first edge of the block of videodata (e.g., the left most pixel of row 268, which has an index valueof 1) and a last pixel adjacent to the second edge of the block of videodata (e.g., the right most pixel of row 268, which has an index value of3), the last pixel of the first line is adjacent to the last pixel ofthe second line, and the first edge and the second edge are parallel,and the last pixel in the first line has the same index value as thelast pixel in the second line, but has a different index value from thefirst pixel in the second line. This situation (i.e., where the indexvalue of last pixel in the first line is the same as the last pixel inthe second line, but different from the first pixel in the second line)may occur more frequently in computer generated screen content thanother types of video content.

In some examples, video encoder 20 may utilize a snake scan order whenencoding the indices of the map. For instance, video encoder 20 may scanthe last pixel of the second line directly after the last pixel of thefirst line. In this way, video encoder 20 may improve the efficiency ofrun-length coding.

For example, as opposed to using a raster scan order, video encoder 20may use a snake scan order to code the values of map 240. In an examplefor purposes of illustration, consider rows 266, 268, and 270 of map240. Using a snake scan order (such as a snake scanning order), videoencoder 20 may code the values of map 240 beginning with the leftposition of row 266, proceeding through to the right most position ofrow 266, moving down to the left most position of row 268, proceedingthrough to the left most position of row 268, and moving down to theleft most position of row 270. For instance, video encoder 20 may encodeone or more syntax elements indicating that the first position of row266 is one and that the next run of two consecutive entries in the scandirection are the same as the first position of row 266.

Video encoder 20 may encode one or more syntax elements indicating thatthe next position of row 266 (i.e., the fourth position, from left toright) is two and that the next consecutive entry in the scan directionare the same as the fourth position of row 266. Video encoder 20 mayencode one or more syntax elements indicating that the next position ofrow 266 (i.e., the sixth position) is three and that the next run offive consecutive entries in the scan direction are the same as the sixthposition of row 266. Video encoder 20 may encode one or more syntaxelements indicating that the next position in the scan direction (i.e.,the fourth position of row 268, from right to left) of row 268 is oneand that the next run of nine consecutive entries in the scan directionare the same as the fourth position of row 268.

In this way, by using a snake scan order, video encoder 20 may encodelonger length runs, which may improve coding efficiency. For example,using the raster scan, the final run of row 266 (for the index value 3)is equal to 2. Using the snake scan, however, the final run of row 266extends into row 268 and is equal to 5.

Video decoder 30 may receive the syntax elements described above andreconstruct rows 266, 268, and 270. For example, video decoder 30 mayobtain, from an encoded bitstream, data indicating an index value for aposition of map 240 currently being coded. Video decoder 30 may alsoobtain data indicating the number of consecutive positions in the scanorder having the same index value.

FIG. 6 is a flowchart illustrating an example process for decoding ablock of video data using palette mode, in accordance with one or moretechniques of this disclosure. The techniques of FIG. 6 may be performedby a video decoder, such as video decoder 30 illustrated in FIG. 1 andFIG. 3. For purposes of illustration, the techniques of FIG. 6 aredescribed within the context of video decoder 30 of FIG. 1 and FIG. 3,although video decoders having configurations different than that ofvideo decoder 30 may perform the techniques of FIG. 6.

As discussed above, it may be desirable to maximize the number of bypassmode coded bins of syntax elements that are grouped together. Inaccordance with one or more techniques of this disclosure, video decoder30 may decode, from a coded video bitstream and using bypass mode, agroup of syntax elements for a palette for a current block of video data(602). For instance, entropy decoding unit 150 of video decoder 30 maydecode, using bypass mode, bins of one or more syntax elements thatindicate a number of zeros that precede a non-zero entry in an arraythat indicates whether entries from a predictor palette are reused inthe current palette (e.g., one or more palette_predictor_run syntaxelements), a syntax element that indicates a number of entries in thecurrent palette that are explicitly signalled (e.g., anum_signalled_palette_entries syntax element), one or more syntaxelements that each indicate a value of a component in an entry in thecurrent palette (e.g., one or more palette_entry syntax elements), asyntax element that indicates whether the current block of video dataincludes at least one escape coded sample (e.g., apalette_escape_val_present_flag syntax element), a syntax element thatindicates a number of entries in the current palette that are explicitlysignalled or inferred (e.g., a num_palette_indices_idc syntax element),and one or more syntax elements that indicate indices in an array ofcurrent palette entries (e.g., one or more palette_index_idc syntaxelements). In some examples, to decode a group of bypass-coded syntaxelements, video decoder 30 may sequentially decode syntax elementsincluded in the group of syntax elements without decoding any non-bypasscoded bins. As discussed above, grouping together a large number ofbypass coded bins/syntax elements may improve a CABAC throughput ofvideo decoder 30. In particular, the grouping of bypass-coded syntaxelements may enable video decoder 30 to avoidstarting/stopping/restarting the CABAC engine. By contrast, when thebypass-coded syntax elements are not grouped, video decoder 30 may haveto continually start the CABAC engine to decode a non-bypass-coded binwith a first context, stop the CABAC engine to decode a bypass-codedbin, start the CABAC engine to decode another non-bypass-coded bin withthe first context, etc. As discussed above, the repeated toggling of theCABAC engine may decrease the CABAC engine's throughput.

Video decoder 30 may decode, using CABAC with a context and at aposition in the coded video bitstream that is after the group of syntaxelements, a syntax element that indicates whether a transpose process isapplied to palette indices of the palette for the current block of videodata (604). For instance, entropy decoding unit 150 of video decoder 30may decode, using CABAC with a context, the bin of apalette_transpose_flag syntax element.

Video decoder 30 may decode, using CABAC with a context and at aposition in the coded video bitstream that is after the syntax elementthat indicates whether a transpose process is applied to palette indicesof the palette for the current block of video data, one or more syntaxelements related to delta quantization parameter (QP) and/or chroma QPoffsets for the current block of video data (606). For instance, entropydecoding unit 150 of video decoder 30 may decode, using CABAC with oneor more contexts, bins of a syntax elements that specifies the absolutevalue of a difference between a QP (e.g., a luma QP) for the currentblock of video data and a predictor of the QP for the current block(e.g., cu_qp_delta_abs), a syntax element that specifies a sign of thedifference between the QP for the current block of video data and thepredictor of the QP for the current block (e.g., cu_qp_delta_sign_flag),a syntax element that indicates whether entries in one or more offsetlists are added to a luma QP for the current block to determine chromaQPs for the current block (e.g., cu_chroma_qp_offset_flag), and a syntaxelement that specifies an index of an entry in each of the one or moreoffset lists that are added to the luma QP for the current block todetermine chroma QPs for the current block (e.g.,cu_chroma_qp_offset_idx).

In some examples, video decoder 30 may decode the one or more syntaxelements related to delta QP and/or chroma QP offsets for the currentblock of video data based on a value of a syntax element of the group ofsyntax elements decoded using bypass mode. As one example, video decoder30 may decode the one or more syntax elements related to delta QP and/orchroma QP offsets for the current block of video data where the syntaxelement of the group of syntax elements that indicates whether thecurrent block of video data includes at least one escape coded sampleindicates that the current block of video data does include at least oneescape sample. As another example, video decoder 30 may not decode theone or more syntax elements related to delta QP and/or chroma QP offsetsfor the current block of video data where the syntax element of thegroup of syntax elements that indicates whether the current block ofvideo data includes at least one escape coded sample indicates that thecurrent block of video data does not include at least one escape sample.

Video decoder 30 may generate the palette for the current block of videodata based on the group of syntax elements and the syntax element thatindicates whether a transpose process is applied to palette indices ofthe palette for the current block of video data (608) and decode thecurrent block of video data based on the generated palette and the oneor more syntax elements related to delta QP and/or chroma QP offsets forthe current block of video data (610). For instance, palette-baseddecoding unit 165 may generate the palette having entries indicatingpixel values, receive information associating at least some positions ofthe current block of video data with entries in the palette, selectpixel values in the palette based on the information, and reconstructpixel values of the block based on the selected pixel values.

FIG. 7 is a flowchart illustrating an example process for encoding ablock of video data using palette mode, in accordance with one or moretechniques of this disclosure. The techniques of FIG. 7 may be performedby a video encoder, such as video encoder 20 illustrated in FIG. 1 andFIG. 2. For purposes of illustration, the techniques of FIG. 7 aredescribed within the context of video encoder 20 of FIG. 1 and FIG. 2,although video encoders having configurations different than that ofvideo encoder 20 may perform the techniques of FIG. 7.

As discussed above, it may be desirable to maximize the number of bypassmode coded bins of syntax elements that are grouped together. Inaccordance with one or more techniques of this disclosure, video encoder20 may encode, in a coded video bitstream and using bypass mode, a groupof syntax elements for a palette for a current block of video data(702). For instance, entropy encoding unit 118 of video encoder 20 mayencode, using bypass mode, bins of one or more syntax elements thatindicate a number of zeros that precede a non-zero entry in an arraythat indicates whether entries from a predictor palette are reused inthe current palette (e.g., one or more palette_predictor_run syntaxelements), a syntax element that indicates a number of entries in thecurrent palette that are explicitly signalled (e.g., anum_signalled_palette_entries syntax element), one or more syntaxelements that each indicate a value of a component in an entry in thecurrent palette (e.g., one or more palette_entry syntax elements), asyntax element that indicates whether the current block of video dataincludes at least one escape coded sample (e.g., apalette_escape_val_present_flag syntax element), a syntax element thatindicates a number of entries in the current palette that are explicitlysignalled or inferred (e.g., a num_palette_indices_idc or anum_palette_indices_minus1 syntax element), and one or more syntaxelements that indicate indices in an array of current palette entries(e.g., one or more palette_index_idc syntax elements).

Video encoder 20 may encode, using CABAC with a context and at aposition in the coded video bitstream that is after the group of syntaxelements, a syntax element that indicates whether a transpose process isapplied to palette indices of the palette for the current block of videodata (704). For instance, entropy encoding unit 118 of video encoder 20may encode, using CABAC with a context, the bin of apalette_transpose_flag syntax element.

Video encoder 20 may encode, using CABAC with a context and at aposition in the coded video bitstream that is after the syntax elementthat indicates whether a transpose process is applied to palette indicesof the palette for the current block of video data, one or more syntaxelements related to delta quantization parameter (QP) and/or chroma QPoffsets for the current block of video data (706). For instance, entropyencoding unit 118 of video encoder 20 may encode, using CABAC with oneor more contexts, bins of a syntax elements that specifies the absolutevalue of a difference between a luma QP for the current block of videodata and a predictor of the luma QP for the current block (e.g.,cu_qp_delta_abs), a syntax element that specifies a sign of thedifference between the luma QP for the current block of video data andthe predictor of the luma QP for the current block (e.g.,cu_qp_delta_sign_flag), a syntax element that indicates whether entriesin one or more offset lists are added to the luma QP for the currentblock to determine chroma QPs for the current block (e.g.,cu_chroma_qp_offset_flag), and a syntax element that specifies an indexof an entry in each of the one or more offset lists that are added tothe luma QP for the current block to determine chroma QPs for thecurrent block (e.g., cu_chroma_qp_offset_idx).

In some examples, video encoder 20 may encode the one or more syntaxelements related to delta QP and/or chroma QP offsets for the currentblock of video data based on a value of a syntax element of the group ofsyntax elements encoded using bypass mode. As one example, video encoder20 may encode the one or more syntax elements related to delta QP and/orchroma QP offsets for the current block of video data where the syntaxelement of the group of syntax elements that indicates whether thecurrent block of video data includes at least one escape coded sampleindicates that the current block of video data does include at least oneescape sample. As another example, video encoder 20 may not encode theone or more syntax elements related to delta QP and/or chroma QP offsetsfor the current block of video data where the syntax element of thegroup of syntax elements that indicates whether the current block ofvideo data includes at least one escape coded sample indicates that thecurrent block of video data does not include at least one escape sample.

It is to be recognized that depending on the example, certain acts orevents of any of the techniques described herein can be performed in adifferent sequence, may be added, merged, or left out altogether (e.g.,not all described acts or events are necessary for the practice of thetechniques). Moreover, in certain examples, acts or events may beperformed concurrently, e.g., through multi-threaded processing,interrupt processing, or multiple processors, rather than sequentially.In addition, while certain aspects of this disclosure are described asbeing performed by a single module or unit for purposes of clarity, itshould be understood that the techniques of this disclosure may beperformed by a combination of units or modules associated with a videocoder.

Certain aspects of this disclosure have been described with respect tothe developing HEVC standard for purposes of illustration. However, thetechniques described in this disclosure may be useful for other videocoding processes, including other standard or proprietary video codingprocesses not yet developed.

The techniques described above may be performed by video encoder 20(FIGS. 1 and 2) and/or video decoder 30 (FIGS. 1 and 3), both of whichmay be generally referred to as a video coder. Likewise, video codingmay refer to video encoding or video decoding, as applicable.

While particular combinations of various aspects of the techniques aredescribed above, these combinations are provided merely to illustrateexamples of the techniques described in this disclosure. Accordingly,the techniques of this disclosure should not be limited to these examplecombinations and may encompass any conceivable combination of thevarious aspects of the techniques described in this disclosure.

In one or more examples, the functions described may be implemented inhardware, software, firmware, or any combination thereof. If implementedin software, the functions may be stored on or transmitted over, as oneor more instructions or code, a computer-readable medium and executed bya hardware-based processing unit. Computer-readable media may includecomputer-readable storage media, which corresponds to a tangible mediumsuch as data storage media, or communication media including any mediumthat facilitates transfer of a computer program from one place toanother, e.g., according to a communication protocol. In this manner,computer-readable media generally may correspond to (1) tangiblecomputer-readable storage media which is non-transitory or (2) acommunication medium such as a signal or carrier wave. Data storagemedia may be any available media that can be accessed by one or morecomputers or one or more processors to retrieve instructions, codeand/or data structures for implementation of the techniques described inthis disclosure. A computer program product may include acomputer-readable medium.

By way of example, and not limitation, such computer-readable storagemedia can comprise RAM, ROM, EEPROM, CD-ROM or other optical diskstorage, magnetic disk storage, or other magnetic storage devices, flashmemory, or any other medium that can be used to store desired programcode in the form of instructions or data structures and that can beaccessed by a computer. Also, any connection is properly termed acomputer-readable medium. For example, if instructions are transmittedfrom a website, server, or other remote source using a coaxial cable,fiber optic cable, twisted pair, digital subscriber line (DSL), orwireless technologies such as infrared, radio, and microwave, then thecoaxial cable, fiber optic cable, twisted pair, DSL, or wirelesstechnologies such as infrared, radio, and microwave are included in thedefinition of medium. It should be understood, however, thatcomputer-readable storage media and data storage media do not includeconnections, carrier waves, signals, or other transient media, but areinstead directed to non-transient, tangible storage media. Disk anddisc, as used herein, includes compact disc (CD), laser disc, opticaldisc, digital versatile disc (DVD), floppy disk and Blu-ray disc, wheredisks usually reproduce data magnetically, while discs reproduce dataoptically with lasers. Combinations of the above should also be includedwithin the scope of computer-readable media.

Instructions may be executed by one or more processors, such as one ormore digital signal processors (DSPs), general purpose microprocessors,application specific integrated circuits (ASICs), field programmablelogic arrays (FPGAs), or other equivalent integrated or discrete logiccircuitry. Accordingly, the term “processor,” as used herein may referto any of the foregoing structure or any other structure suitable forimplementation of the techniques described herein. In addition, in someaspects, the functionality described herein may be provided withindedicated hardware and/or software modules configured for encoding anddecoding, or incorporated in a combined codec. Also, the techniquescould be fully implemented in one or more circuits or logic elements.

The techniques of this disclosure may be implemented in a wide varietyof devices or apparatuses, including a wireless handset, an integratedcircuit (IC) or a set of ICs (e.g., a chip set). Various components,modules, or units are described in this disclosure to emphasizefunctional aspects of devices configured to perform the disclosedtechniques, but do not necessarily require realization by differenthardware units. Rather, as described above, various units may becombined in a codec hardware unit or provided by a collection ofinteroperative hardware units, including one or more processors asdescribed above, in conjunction with suitable software and/or firmware.

Various examples have been described. These and other examples arewithin the scope of the following claims.

What is claimed is:
 1. A method of decoding video data, the methodcomprising: decoding, from a coded video bitstream, a syntax elementthat indicates whether a transpose process is applied to palette indicesof a palette for a current block of video data; decoding, from the codedvideo bitstream and at a position in the coded video bitstream that isafter the syntax element that indicates whether the transpose process isapplied to palette indices of the palette for the current block of videodata, one or more syntax elements related to delta quantizationparameter (QP) and/or chroma QP offsets for the current block of videodata; and decoding the current block of video data based on the palettefor the current block of video data and the one or more syntax elementsrelated to delta QP and/or chroma QP offsets for the current block ofvideo data.
 2. The method of claim 1, wherein: decoding the syntaxelement that indicates whether the transpose process is applied topalette indices of the current block of video data comprises decodingthe syntax element that indicates whether the transpose process isapplied to palette indices of the current block of video data usingcontext adaptive binary arithmetic coding (CABAC) with a context, anddecoding the one or more syntax elements related to delta QP and/orchroma QP offsets comprises decoding the one or more syntax elementsrelated to delta QP and/or chroma QP offsets using CABAC with a context.3. The method of claim 1 wherein the syntax element that indicateswhether the transpose process is applied to palette indices of thecurrent block of video data comprises a palette_transpose_flag syntaxelement.
 4. The method of claim 1, wherein the one or more syntaxelements related to delta QP comprise one or both of a syntax elementthat indicates an absolute value of a difference between a QP of thecurrent block and a predictor of the QP of the current block and asyntax element that indicates a sign of the difference between the QP ofthe current block and the predictor of the QP of the current block. 5.The method of claim 1, wherein the one or more syntax elements relatedto chroma QP offsets comprise one or both of a syntax element thatindicates whether entries in one or more offset lists are added to aluma QP of the current block to determine chroma QPs for the currentblock and a syntax element that indicates an index of an entry in eachof the one or more offset lists that are added to the luma QP for thecurrent block to determine the chroma QPs for the current block.
 6. Themethod of claim 1, further comprising: decoding, from the coded videobitstream, a group of syntax elements using Bypass mode, wherein thegroup comprises one or more of: one or more syntax elements thatindicate a number of zeros that precede a non-zero entry in an arraythat indicates whether entries from a predictor palette are reused inthe current palette, a syntax element that indicates a number of entriesin the current palette that are explicitly signalled, one or more syntaxelements that each indicate a value of a component in an entry in thecurrent palette, a syntax element that indicates whether the currentblock of video data includes at least one escape coded sample, a syntaxelement that indicates a number of indices in the current palette thatare explicitly signalled or inferred, and one or more syntax elementsthat indicate indices in an array of current palette entries.
 7. Themethod of claim 6, wherein one or more of: the one or more syntaxelements that indicate a number of zeros that precede a non-zero entryin an array that indicates whether entries from a predictor palette arereused in the current palette comprise one or more palette_predictor_runsyntax elements, the syntax element that indicates a number of entriesin the current palette that are explicitly signalled comprises anum_signalled_palette_entries syntax element, the one or more syntaxelements that each indicate a value of a component in an entry in thecurrent palette comprise one or more palette_entry syntax elements, thesyntax element that indicates whether the current block of video dataincludes at least one escape coded sample comprisespalette_escape_val_present_flag, the syntax element that indicates anumber of indices in the current palette that are explicitly signalledor inferred comprise a num_palette_indices_idc syntax element, and theone or more syntax elements that indicate indices in an array of currentpalette entries comprise one or more palette_index_idc syntax elements.8. The method of claim 6, wherein decoding the group of syntax elementscomprises decoding the group of syntax elements from the coded videobitstream at a position in the coded video bitstream that is before thesyntax element that indicates whether the transpose process is appliedto palette indices of the current block of video data.
 9. The method ofclaim 6, further comprising: decoding, from the coded video bitstreamafter the group of syntax elements coded using Bypass mode, a syntaxelement that indicates a last occurrence of a run type flag within thecurrent block of video data.
 10. The method of claim 9, wherein decodingthe syntax element that indicates the last occurrence of a run type flagwithin the current block of video data comprises decoding the syntaxelement that indicates the last occurrence of a run type flag within thecurrent block of video data using context adaptive binary arithmeticcoding (CABAC) with a context.
 11. A method of encoding video data, themethod comprising: encoding, in a coded video bitstream, a syntaxelement that indicates whether a transpose process is applied to paletteindices of a palette for a current block of video data; encoding, in thecoded video bitstream and at a position in the coded video bitstreamthat is after the syntax element that indicates whether the transposeprocess is applied to palette indices of the palette for the currentblock of video data, one or more syntax elements related to deltaquantization parameter (QP) and/or chroma QP offsets for the currentblock of video data; and encoding the current block of video data basedon the palette for the current block of video data and the one or moresyntax elements related to delta QP and/or chroma QP offsets for thecurrent block of video data.
 12. The method of claim 11, wherein:encoding the syntax element that indicates whether the transpose processis applied to palette indices of the current block of video datacomprises encoding the syntax element that indicates whether thetranspose process is applied to palette indices of the current block ofvideo data using context adaptive binary arithmetic coding (CABAC) witha context, and encoding the one or more syntax elements related to deltaQP and/or chroma QP offsets comprises encoding the one or more syntaxelements related to delta QP and/or chroma QP offsets using CABAC with acontext.
 13. The method of claim 11 wherein the syntax element thatindicates whether the transpose process is applied to palette indices ofthe current block of video data comprises a palette_transpose_flagsyntax element.
 14. The method of claim 11, wherein the one or moresyntax elements related to delta QP comprise one or both of a syntaxelement that indicates an absolute value of a difference between a QP ofthe current block and a predictor of the QP of the current block and asyntax element that indicates a sign of the difference between the QP ofthe current block and the predictor of the QP of the current block. 15.The method of claim 11, wherein the one or more syntax elements relatedto chroma QP offsets comprise one or both of a syntax element thatindicates whether entries in one or more offset lists are added to aluma QP of the current block to determine chroma QPs for the currentblock and a syntax element that indicates an index of an entry in eachof the one or more offset lists that are added to the luma QP for thecurrent block to determine the chroma QPs for the current block.
 16. Themethod of claim 11, further comprising: encoding, in the coded videobitstream, a group of syntax elements using Bypass mode, wherein thegroup comprises one or more of: one or more syntax elements thatindicate a number of zeros that precede a non-zero entry in an arraythat indicates whether entries from a predictor palette are reused inthe current palette, a syntax element that indicates a number of entriesin the current palette that are explicitly signalled, one or more syntaxelements that each indicate a value of a component in an entry in thecurrent palette, a syntax element that indicates whether the currentblock of video data includes at least one escape coded sample, a syntaxelement that indicates a number of indices in the current palette thatare explicitly signalled or inferred, and one or more syntax elementsthat indicate indices in an array of current palette entries.
 17. Themethod of claim 16, wherein one or more of: the one or more syntaxelements that indicate a number of zeros that precede a non-zero entryin an array that indicates whether entries from a predictor palette arereused in the current palette comprise one or more palette_predictor_runsyntax elements, the syntax element that indicates a number of entriesin the current palette that are explicitly signalled comprises anum_signalled_palette_entries syntax element, the one or more syntaxelements that each indicate a value of a component in an entry in thecurrent palette comprise one or more palette_entry syntax elements, thesyntax element that indicates whether the current block of video dataincludes at least one escape coded sample comprisespalette_escape_val_present_flag, the syntax element that indicates anumber of indices in the current palette that are explicitly signalledor inferred comprise a num_palette_indices_minus1 syntax element, andthe one or more syntax elements that indicate indices in an array ofcurrent palette entries comprise one or more palette_index_idc syntaxelements.
 18. The method of claim 16, wherein encoding the group ofsyntax elements comprises encoding the group of syntax elements in thecoded video bitstream at a position in the coded video bitstream that isbefore the syntax element that indicates whether the transpose processis applied to palette indices of the current block of video data. 19.The method of claim 16, further comprising: encoding, in the coded videobitstream after the group of syntax elements coded using Bypass mode, asyntax element that indicates a last occurrence of a run type flagwithin the current block of video data.
 20. The method of claim 19,wherein encoding the syntax element that indicates the last occurrenceof a run type flag within the current block of video data comprisesencoding the syntax element that indicates the last occurrence of a runtype flag within the current block of video data using context adaptivebinary arithmetic coding (CABAC) with a context.
 21. A device forencoding or decoding video data, the device comprising: a memoryconfigured to store video data; one or more processors configured to:encode or decode, in a coded video bitstream, a syntax element thatindicates whether a transpose process is applied to palette indices of apalette for a current block of video data; encode or decode, in thecoded video bitstream and at a position in the coded video bitstreamthat is after the syntax element that indicates whether the transposeprocess is applied to palette indices of the palette for the currentblock of video data, one or more syntax elements related to deltaquantization parameter (QP) and/or chroma QP offsets for the currentblock of video data; and encode or decode the current block of videodata based on the palette for the current block of video data and theone or more syntax elements related to delta QP and/or chroma QP offsetsfor the current block of video data.
 22. The device of claim 21,wherein: to encode or decode the syntax element that indicates whetherthe transpose process is applied to palette indices of the current blockof video data, the one or more processors are configured to encode ordecode the syntax element that indicates whether the transpose processis applied to palette indices of the current block of video data usingcontext adaptive binary arithmetic coding (CABAC) with a context, and toencode or decode the one or more syntax elements related to delta QPand/or chroma QP offsets the one or more processors are configured toencode or decode the one or more syntax elements related to delta QPand/or chroma QP offsets using CABAC with a context.
 23. The device ofclaim 21 wherein the syntax element that indicates whether the transposeprocess is applied to palette indices of the current block of video datacomprises a palette_transpose_flag syntax element.
 24. The device ofclaim 21, where in the one or more processors are further configured to:encode or decode, in the coded video bitstream, a group of syntaxelements using Bypass mode, wherein the group comprises one or more of:one or more syntax elements that indicate a number of zeros that precedea non-zero entry in an array that indicates whether entries from apredictor palette are reused in the current palette, a syntax elementthat indicates a number of entries in the current palette that areexplicitly signalled, one or more syntax elements that each indicate avalue of a component in an entry in the current palette, a syntaxelement that indicates whether the current block of video data includesat least one escape coded sample, a syntax element that indicates anumber of indices in the current palette that are explicitly signalledor inferred, and one or more syntax elements that indicate indices in anarray of current palette entries.
 25. The device of claim 24, whereinone or more of: the one or more syntax elements that indicate a numberof zeros that precede a non-zero entry in an array that indicateswhether entries from a predictor palette are reused in the currentpalette comprise one or more palette_predictor_run syntax elements, thesyntax element that indicates a number of entries in the current palettethat are explicitly signalled comprises a num_signalled_palette_entriessyntax element, the one or more syntax elements that each indicate avalue of a component in an entry in the current palette comprise one ormore palette_entry syntax elements, the syntax element that indicateswhether the current block of video data includes at least one escapecoded sample comprises palette_escape_val_present_flag, the syntaxelement that indicates a number of entries in the current palette thatare explicitly signalled or inferred comprise anum_palette_indices_minus1 syntax element, and the one or more syntaxelements that indicate indices in an array of current palette entriescomprise one or more palette_index_idc syntax elements.
 26. The deviceof claim 24, wherein, to encode or decode the group of syntax elements,the one or more processors are configured to encode or decode the groupof syntax elements in the coded video bitstream at a position in thecoded video bitstream that is before the syntax element that indicateswhether the transpose process is applied to palette indices of thecurrent block of video data.
 27. The device of claim 24, wherein the oneor more processors are further configured to: encode or decode, in thecoded video bitstream after the group of syntax elements coded usingBypass mode, a syntax element that indicates a last occurrence of a runtype flag within the current block of video data.
 28. The device ofclaim 27, wherein, to encode or decode the syntax element that indicatesthe last occurrence of a run type flag within the current block of videodata, the one or more processors are configured to encode or decode thesyntax element that indicates the last occurrence of a run type flagwithin the current block of video data using context adaptive binaryarithmetic coding (CABAC) with a context.
 29. A device for decodingvideo data, the device comprising: means for decoding, from a codedvideo bitstream, a syntax element that indicates whether a transposeprocess is applied to palette indices of a palette for a current blockof video data; means for decoding, from the coded video bitstream and ata position in the coded video bitstream that is after the syntax elementthat indicates whether the transpose process is applied to paletteindices of the palette for the current block of video data, one or moresyntax elements related to delta quantization parameter (QP) and/orchroma QP offsets for the current block of video data; and means fordecoding the current block of video data based on the palette for thecurrent block of video data and the one or more syntax elements relatedto delta QP and/or chroma QP offsets for the current block of videodata.
 30. A computer-readable storage medium storing at least a portionof a coded video bitstream that, when processed by a video decodingdevice, cause one or more processors of the video decoding device to:determine whether a transpose process is applied to palette indices of apalette for a current block of video data; and decode the current blockof the video data based on the palette for the current block of videodata and a delta quantization parameter (QP) and one or more chroma QPoffsets for the current block of video data, wherein one or more syntaxelements related to the delta QP and one or more syntax elements relatedto the one or more chroma QP offsets for the current block of video dataare located at a position in the coded video bitstream that is after asyntax element that indicates whether the transpose process is appliedto palette indices of the palette for the current block of video data.